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.
This commit is contained in:
parent
0421335ac1
commit
cb352bb029
|
@ -627,11 +627,8 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
|
||||||
|
|
||||||
if( m_page_bitmap->IsOk() )
|
if( m_page_bitmap->IsOk() )
|
||||||
{
|
{
|
||||||
// Calculate layout preview scale.
|
double scaleW = (double) lyWidth / clamped_layout_size.x;
|
||||||
int appScale = m_screen->MilsToIuScalar();
|
double scaleH = (double) lyHeight / clamped_layout_size.y;
|
||||||
|
|
||||||
double scaleW = (double) lyWidth / clamped_layout_size.x / appScale;
|
|
||||||
double scaleH = (double) lyHeight / clamped_layout_size.y / appScale;
|
|
||||||
|
|
||||||
// Prepare DC.
|
// Prepare DC.
|
||||||
wxSize example_size( lyWidth + 1, lyHeight + 1 );
|
wxSize example_size( lyWidth + 1, lyHeight + 1 );
|
||||||
|
@ -664,10 +661,11 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
|
||||||
GRResetPenAndBrush( &memDC );
|
GRResetPenAndBrush( &memDC );
|
||||||
|
|
||||||
WORKSHEET_LAYOUT::SetAltInstance( m_pagelayout );
|
WORKSHEET_LAYOUT::SetAltInstance( m_pagelayout );
|
||||||
|
GRFilledRect( NULL, &memDC, 0, 0, m_layout_size.x, m_layout_size.y, WHITE, WHITE );
|
||||||
DrawPageLayout( &memDC, NULL, pageDUMMY,
|
DrawPageLayout( &memDC, NULL, pageDUMMY,
|
||||||
emptyString, emptyString,
|
emptyString, emptyString,
|
||||||
m_tb, m_screen->m_NumberOfScreens,
|
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 );
|
memDC.SelectObject( wxNullBitmap );
|
||||||
m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );
|
m_PageLayoutExampleBitmap->SetBitmap( *m_page_bitmap );
|
||||||
|
|
Loading…
Reference in New Issue