From e453b5b87b08fa7eef7427f591b9a7b4c5db683c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 20 Oct 2018 18:31:19 +0200 Subject: [PATCH] Page layout bitmap size wrong in modern/GAL canvases. The image scale set by pl_editor was not taken in account when drawing the page layout. --- common/worksheet_viewitem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/worksheet_viewitem.cpp b/common/worksheet_viewitem.cpp index 2910d3d01f..a167640d2d 100644 --- a/common/worksheet_viewitem.cpp +++ b/common/worksheet_viewitem.cpp @@ -206,6 +206,14 @@ void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_BITMAP* aItem, GAL* aGal ) con VECTOR2D position = aItem->GetPosition(); aGal->Translate( position ); WORKSHEET_DATAITEM_BITMAP* parent = static_cast( aItem->GetParent() ); + + // When the image scale factor is not 1.0, we need to modify the actual scale + // as the image scale factor is similar to a local zoom + double img_scale = parent->m_ImageBitmap->GetScale(); + + if( img_scale != 1.0 ) + aGal->Scale( VECTOR2D( img_scale, img_scale ) ); + aGal->DrawBitmap( *parent->m_ImageBitmap ); aGal->Restore(); }