From cb352bb0293d1011205225b942c04224b2ed1166 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 23 Feb 2019 06:22:27 -0800 Subject: [PATCH] Set Page Layout preview scale and clear bg The preview scale is always in mil, so leave the scale factor as implied as 1; Draw a white rectangle for the page layout preview background. --- common/dialogs/dialog_page_settings.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 1d297cace8..60f53321cd 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -627,11 +627,8 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() if( m_page_bitmap->IsOk() ) { - // Calculate layout preview scale. - int appScale = m_screen->MilsToIuScalar(); - - double scaleW = (double) lyWidth / clamped_layout_size.x / appScale; - double scaleH = (double) lyHeight / clamped_layout_size.y / appScale; + double scaleW = (double) lyWidth / clamped_layout_size.x; + double scaleH = (double) lyHeight / clamped_layout_size.y; // Prepare DC. wxSize example_size( lyWidth + 1, lyHeight + 1 ); @@ -664,10 +661,11 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() GRResetPenAndBrush( &memDC ); WORKSHEET_LAYOUT::SetAltInstance( m_pagelayout ); + GRFilledRect( NULL, &memDC, 0, 0, m_layout_size.x, m_layout_size.y, WHITE, WHITE ); DrawPageLayout( &memDC, NULL, pageDUMMY, emptyString, emptyString, m_tb, m_screen->m_NumberOfScreens, - m_screen->m_ScreenNumber, 1, appScale, DARKGRAY, RED ); + m_screen->m_ScreenNumber, 1, 1, DARKGRAY, RED ); memDC.SelectObject( wxNullBitmap ); m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );