Commit 477e98dc authored by jean-pierre charras's avatar jean-pierre charras

Fix 2 minor bugs:

* Pcbnew: in hight contrast mode the 'V' hotkey did not always refresh the screen.
* Eeschema: incorrect print scale when the option 'Show page limits' is disable.
parent aaa62cdd
...@@ -1032,7 +1032,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid ...@@ -1032,7 +1032,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_wid
Color = RED; Color = RED;
// if not printing, draw the page limits: // if not printing, draw the page limits:
if( !screen->m_IsPrinting & g_ShowPageLimits ) if( !screen->m_IsPrinting && g_ShowPageLimits )
{ {
GRSetDrawMode( DC, GR_COPY ); GRSetDrawMode( DC, GR_COPY );
GRRect( m_canvas->GetClipBox(), DC, 0, 0, GRRect( m_canvas->GetClipBox(), DC, 0, 0,
......
...@@ -335,31 +335,9 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen ) ...@@ -335,31 +335,9 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
// Change scale factor and offset to print the whole page. // Change scale factor and offset to print the whole page.
bool printReference = parent->GetPrintSheetReference(); bool printReference = parent->GetPrintSheetReference();
if( printReference )
{
// Draw the page to a memory and let the dc calculate the drawing limits.
wxBitmap psuedoBitmap( 1, 1 );
wxMemoryDC memDC;
memDC.SelectObject( psuedoBitmap );
aScreen->Draw( panel, &memDC, GR_DEFAULT_DRAWMODE );
parent->TraceWorkSheet( &memDC, aScreen, g_DrawDefaultLineThickness );
wxLogDebug( wxT( "MinX = %d, MaxX = %d, MinY = %d, MaxY = %d" ),
memDC.MinX(), memDC.MaxX(), memDC.MinY(), memDC.MaxY() );
pageSizeIU.x = memDC.MaxX() - memDC.MinX();
pageSizeIU.y = memDC.MaxY() - memDC.MinY();
FitThisSizeToPageMargins( pageSizeIU, parent->GetPageSetupData() );
fitRect = GetLogicalPageMarginsRect( parent->GetPageSetupData() );
}
else
{
pageSizeIU = aScreen->GetPageSettings().GetSizeIU(); pageSizeIU = aScreen->GetPageSettings().GetSizeIU();
FitThisSizeToPaper( pageSizeIU ); FitThisSizeToPaper( pageSizeIU );
fitRect = GetLogicalPaperRect(); fitRect = GetLogicalPaperRect();
}
wxLogDebug( wxT( "Fit rectangle: %d, %d, %d, %d" ), wxLogDebug( wxT( "Fit rectangle: %d, %d, %d, %d" ),
fitRect.x, fitRect.y, fitRect.width, fitRect.height ); fitRect.x, fitRect.y, fitRect.width, fitRect.height );
......
...@@ -519,6 +519,8 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -519,6 +519,8 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
if( !itemCurrentlyEdited ) // no track in progress: switch layer only if( !itemCurrentlyEdited ) // no track in progress: switch layer only
{ {
Other_Layer_Route( NULL, aDC ); Other_Layer_Route( NULL, aDC );
if( DisplayOpt.ContrastModeDisplay )
m_canvas->Refresh();
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment