Loading common/copy_to_clipboard.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -39,9 +39,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event ) if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); } } Loading common/drawframe.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -340,9 +340,7 @@ void WinEDA_DrawFrame::ReDrawPanel() if( DrawPanel == NULL ) return; wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); DrawPanel->ReDraw( &dc ); } Loading Loading @@ -599,9 +597,8 @@ void WinEDA_DrawFrame::AdjustScrollBars() int x, y, scroll_x, scroll_y; double scale_x, scale_y; wxClientDC DC( this ); DrawPanel DC( this ); DrawPanel->PrepareGraphicContext( &DC ); x = DC.LogicalToDeviceXRel( draw_size.GetWidth() ); y = DC.LogicalToDeviceYRel( draw_size.GetHeight() ); Loading common/drawpanel.cpp +29 −24 Original line number Diff line number Diff line Loading @@ -16,6 +16,26 @@ #define CURSOR_SIZE 12 // Cursor size in pixels // Helper class to handle the client Device Context KicadGraphicContext::KicadGraphicContext( WinEDA_DrawPanel * aDrawPanel ) : wxClientDC(aDrawPanel) { GRResetPenAndBrush( this ); SetBackgroundMode( wxTRANSPARENT ); #ifdef WX_ZOOM double scale = aDrawPanel->GetScreen()->GetScalingFactor(); SetUserScale( scale, scale ); wxPoint origin = aDrawPanel->GetScreen()->m_DrawOrg; SetLogicalOrigin( origin.x, origin.y ); #endif aDrawPanel->SetBoundaryBox(); } KicadGraphicContext::~KicadGraphicContext( ) { } /* Used to inhibit a response to a mouse left button release, after a * double click (when releasing the left button at the end of the second * click. Used in eeschema to inhibit a mouse left release command when Loading Loading @@ -172,19 +192,6 @@ wxRealPoint WinEDA_DrawPanel::GetGrid() } void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC ) { GRResetPenAndBrush( DC ); DC->SetBackgroundMode( wxTRANSPARENT ); #ifdef WX_ZOOM double scale = GetScreen()->GetScalingFactor(); DC->SetUserScale( scale, scale ); wxPoint origin = GetScreen()->m_DrawOrg; DC->SetLogicalOrigin( origin.x, origin.y ); #endif SetBoundaryBox(); } /** Calculate the cursor position in internal units. * @return position (in internal units) Loading @@ -194,8 +201,8 @@ wxPoint WinEDA_DrawPanel::CursorRealPosition( const wxPoint& ScreenPos ) { #ifdef WX_ZOOM wxCoord x, y; wxClientDC DC( this ); PrepareGraphicContext( &DC ); KicadGraphicContext DC( this ); x = DC.DeviceToLogicalX( ScreenPos.x ); y = DC.DeviceToLogicalY( ScreenPos.y ); return wxPoint( x, y ); Loading Loading @@ -304,8 +311,8 @@ wxPoint WinEDA_DrawPanel::CursorScreenPosition() { #ifdef WX_ZOOM wxCoord x, y; wxClientDC DC( this ); PrepareGraphicContext( &DC ); KicadGraphicContext DC( this ); x = DC.LogicalToDeviceX( GetScreen()->m_Curseur.x ); y = DC.LogicalToDeviceY( GetScreen()->m_Curseur.y ); return wxPoint( x, y ); Loading @@ -332,8 +339,7 @@ wxPoint WinEDA_DrawPanel::GetScreenCenterRealPosition( void ) GetScreen()->Unscale( realpos ); #ifdef WX_ZOOM // wxCoord x, y; // wxClientDC DC( this ); // PrepareGraphicContext( &DC ); // KicadGraphicContext DC( this ); // realpos.x = DC.DeviceToLogicalX( realpos.x ); // realpos.y = DC.DeviceToLogicalY( realpos.y ); #else Loading Loading @@ -567,7 +573,6 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) wxRect PaintClipBox; wxPoint org; PrepareGraphicContext( &paintDC ); tmp = m_ClipBox; org = m_ClipBox.GetOrigin(); Loading Loading @@ -1010,11 +1015,11 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event ) screen->m_MousePosition = CursorRealPosition( screen->m_MousePositionInPixels ); wxClientDC DC( this ); KicadGraphicContext DC( this ); int kbstat = 0; DC.SetBackground( *wxBLACK_BRUSH ); PrepareGraphicContext( &DC ); g_KeyPressed = localkey; Loading Loading @@ -1259,10 +1264,10 @@ void WinEDA_DrawPanel::OnKeyEvent( wxKeyEvent& event ) if( event.ShiftDown() && (key > 256) ) localkey |= GR_KB_SHIFT; wxClientDC DC( this ); KicadGraphicContext DC( this ); BASE_SCREEN* Screen = GetScreen(); PrepareGraphicContext( &DC ); g_KeyPressed = localkey; Loading eeschema/dialog_edit_component_in_schematic.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -722,8 +722,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) if( entry == NULL ) return; wxClientDC dc( m_Parent->DrawPanel ); m_Parent->DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( m_Parent->DrawPanel ); RedrawOneStruct( m_Parent->DrawPanel, &dc, m_Cmp, g_XorMode ); Loading eeschema/find.cpp +3 −9 Original line number Diff line number Diff line Loading @@ -179,9 +179,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( Recadre_Trace( mouseWarp ); else { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); EXCHG( old_cursor_position, sheet->LastScreen()->m_Curseur ); DrawPanel->CursorOff( &dc ); Loading Loading @@ -356,9 +354,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType ) Recadre_Trace( TRUE ); else { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); EXCHG( old_cursor_position, sheet->LastScreen()->m_Curseur ); DrawPanel->CursorOff( &dc ); DrawPanel->MouseTo( curpos ); Loading Loading @@ -581,9 +577,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem( const wxString& pattern, Recadre_Trace( mouseWarp ); else { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); EXCHG( old_cursor_position, Sheet->LastScreen()->m_Curseur ); DrawPanel->CursorOff( &dc ); Loading Loading
common/copy_to_clipboard.cpp +1 −3 Original line number Diff line number Diff line Loading @@ -39,9 +39,7 @@ void WinEDA_DrawFrame::CopyToClipboard( wxCommandEvent& event ) if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); } } Loading
common/drawframe.cpp +2 −5 Original line number Diff line number Diff line Loading @@ -340,9 +340,7 @@ void WinEDA_DrawFrame::ReDrawPanel() if( DrawPanel == NULL ) return; wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); DrawPanel->ReDraw( &dc ); } Loading Loading @@ -599,9 +597,8 @@ void WinEDA_DrawFrame::AdjustScrollBars() int x, y, scroll_x, scroll_y; double scale_x, scale_y; wxClientDC DC( this ); DrawPanel DC( this ); DrawPanel->PrepareGraphicContext( &DC ); x = DC.LogicalToDeviceXRel( draw_size.GetWidth() ); y = DC.LogicalToDeviceYRel( draw_size.GetHeight() ); Loading
common/drawpanel.cpp +29 −24 Original line number Diff line number Diff line Loading @@ -16,6 +16,26 @@ #define CURSOR_SIZE 12 // Cursor size in pixels // Helper class to handle the client Device Context KicadGraphicContext::KicadGraphicContext( WinEDA_DrawPanel * aDrawPanel ) : wxClientDC(aDrawPanel) { GRResetPenAndBrush( this ); SetBackgroundMode( wxTRANSPARENT ); #ifdef WX_ZOOM double scale = aDrawPanel->GetScreen()->GetScalingFactor(); SetUserScale( scale, scale ); wxPoint origin = aDrawPanel->GetScreen()->m_DrawOrg; SetLogicalOrigin( origin.x, origin.y ); #endif aDrawPanel->SetBoundaryBox(); } KicadGraphicContext::~KicadGraphicContext( ) { } /* Used to inhibit a response to a mouse left button release, after a * double click (when releasing the left button at the end of the second * click. Used in eeschema to inhibit a mouse left release command when Loading Loading @@ -172,19 +192,6 @@ wxRealPoint WinEDA_DrawPanel::GetGrid() } void WinEDA_DrawPanel::PrepareGraphicContext( wxDC* DC ) { GRResetPenAndBrush( DC ); DC->SetBackgroundMode( wxTRANSPARENT ); #ifdef WX_ZOOM double scale = GetScreen()->GetScalingFactor(); DC->SetUserScale( scale, scale ); wxPoint origin = GetScreen()->m_DrawOrg; DC->SetLogicalOrigin( origin.x, origin.y ); #endif SetBoundaryBox(); } /** Calculate the cursor position in internal units. * @return position (in internal units) Loading @@ -194,8 +201,8 @@ wxPoint WinEDA_DrawPanel::CursorRealPosition( const wxPoint& ScreenPos ) { #ifdef WX_ZOOM wxCoord x, y; wxClientDC DC( this ); PrepareGraphicContext( &DC ); KicadGraphicContext DC( this ); x = DC.DeviceToLogicalX( ScreenPos.x ); y = DC.DeviceToLogicalY( ScreenPos.y ); return wxPoint( x, y ); Loading Loading @@ -304,8 +311,8 @@ wxPoint WinEDA_DrawPanel::CursorScreenPosition() { #ifdef WX_ZOOM wxCoord x, y; wxClientDC DC( this ); PrepareGraphicContext( &DC ); KicadGraphicContext DC( this ); x = DC.LogicalToDeviceX( GetScreen()->m_Curseur.x ); y = DC.LogicalToDeviceY( GetScreen()->m_Curseur.y ); return wxPoint( x, y ); Loading @@ -332,8 +339,7 @@ wxPoint WinEDA_DrawPanel::GetScreenCenterRealPosition( void ) GetScreen()->Unscale( realpos ); #ifdef WX_ZOOM // wxCoord x, y; // wxClientDC DC( this ); // PrepareGraphicContext( &DC ); // KicadGraphicContext DC( this ); // realpos.x = DC.DeviceToLogicalX( realpos.x ); // realpos.y = DC.DeviceToLogicalY( realpos.y ); #else Loading Loading @@ -567,7 +573,6 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) wxRect PaintClipBox; wxPoint org; PrepareGraphicContext( &paintDC ); tmp = m_ClipBox; org = m_ClipBox.GetOrigin(); Loading Loading @@ -1010,11 +1015,11 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event ) screen->m_MousePosition = CursorRealPosition( screen->m_MousePositionInPixels ); wxClientDC DC( this ); KicadGraphicContext DC( this ); int kbstat = 0; DC.SetBackground( *wxBLACK_BRUSH ); PrepareGraphicContext( &DC ); g_KeyPressed = localkey; Loading Loading @@ -1259,10 +1264,10 @@ void WinEDA_DrawPanel::OnKeyEvent( wxKeyEvent& event ) if( event.ShiftDown() && (key > 256) ) localkey |= GR_KB_SHIFT; wxClientDC DC( this ); KicadGraphicContext DC( this ); BASE_SCREEN* Screen = GetScreen(); PrepareGraphicContext( &DC ); g_KeyPressed = localkey; Loading
eeschema/dialog_edit_component_in_schematic.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -722,8 +722,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) if( entry == NULL ) return; wxClientDC dc( m_Parent->DrawPanel ); m_Parent->DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( m_Parent->DrawPanel ); RedrawOneStruct( m_Parent->DrawPanel, &dc, m_Cmp, g_XorMode ); Loading
eeschema/find.cpp +3 −9 Original line number Diff line number Diff line Loading @@ -179,9 +179,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindComponentAndItem( Recadre_Trace( mouseWarp ); else { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); EXCHG( old_cursor_position, sheet->LastScreen()->m_Curseur ); DrawPanel->CursorOff( &dc ); Loading Loading @@ -356,9 +354,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindMarker( int SearchType ) Recadre_Trace( TRUE ); else { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); EXCHG( old_cursor_position, sheet->LastScreen()->m_Curseur ); DrawPanel->CursorOff( &dc ); DrawPanel->MouseTo( curpos ); Loading Loading @@ -581,9 +577,7 @@ SCH_ITEM* WinEDA_SchematicFrame::FindSchematicItem( const wxString& pattern, Recadre_Trace( mouseWarp ); else { wxClientDC dc( DrawPanel ); DrawPanel->PrepareGraphicContext( &dc ); KicadGraphicContext dc( DrawPanel ); EXCHG( old_cursor_position, Sheet->LastScreen()->m_Curseur ); DrawPanel->CursorOff( &dc ); Loading