From cfe308f38f43e546d158ec839ec7bec0075eb3e2 Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Fri, 14 Feb 2025 19:30:06 +0100 Subject: [PATCH] Update print_window.cpp --- src/gui/print_window.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/print_window.cpp b/src/gui/print_window.cpp index 3ebf7ef5..112087fb 100644 --- a/src/gui/print_window.cpp +++ b/src/gui/print_window.cpp @@ -142,8 +142,9 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) { // create buffers int w = int(stylesheet.card_width), h = int(stylesheet.card_height); // in pixels if (is_rad90(rotation)) swap(w,h); - // Draw using text buffer - double zoom = IsPreview() ? 1 : 4; + // Draw using text buffer + bool isPreview = IsPreview(); + double zoom = isPreview ? 1 : 4; wxBitmap buffer(w*zoom,h*zoom,32); wxMemoryDC bufferDC; bufferDC.SelectObject(buffer); @@ -157,7 +158,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) { dc.SetUserScale(scale_x / px_per_mm, scale_y / px_per_mm); dc.SetDeviceOrigin(int(scale_x * pos.x), int(scale_y * pos.y)); bufferDC.SelectObject(wxNullBitmap); - dc.DrawBitmap(buffer, 0, 0); + dc.DrawBitmap(buffer, isPreview ? 0 : int(scale_x * pos.x), isPreview ? 0 : int(scale_y * pos.y)); } // ----------------------------------------------------------------------------- : PrintWindow