From 1e3a5c1b219724d7e1ec9cb3ea46f772fff17cbc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 7 Sep 2018 13:01:01 +0100 Subject: [PATCH] Fixup of last commit. --- common/legacy_gal/block.cpp | 2 -- common/legacy_gal/eda_draw_frame.cpp | 10 ++++++++-- eeschema/controle.cpp | 10 ++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/common/legacy_gal/block.cpp b/common/legacy_gal/block.cpp index 921d4c3be5..122724f493 100644 --- a/common/legacy_gal/block.cpp +++ b/common/legacy_gal/block.cpp @@ -179,8 +179,6 @@ void AbortBlockCurrentCommand( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) if( aPanel->IsMouseCaptured() ) // Erase current drawing on screen { - // Clear block outline. - aPanel->CallMouseCapture( aDC, wxDefaultPosition, false ); aPanel->SetMouseCapture( NULL, NULL ); screen->SetCurItem( NULL ); diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index ceed3354e4..332f287101 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -1186,22 +1186,28 @@ void EDA_DRAW_FRAME::RefreshCrossHair( const wxPoint &aOldPos, const wxPoint &aEvtPos, wxDC* aDC ) { + wxFAIL_MSG( "shouldn't be using RefreshCrossHair() anymore; use CallMouseCapture() directly" ); + + // CrossHair is no longer XORed; no need for most of this +#if 0 wxPoint newpos = GetCrossHairPosition(); // Redraw the crosshair if it moved - //if( aOldPos != newpos ) + if( aOldPos != newpos ) { SetCrossHairPosition( aOldPos, false ); m_canvas->CrossHairOff( aDC ); SetCrossHairPosition( newpos, false ); m_canvas->CrossHairOn( aDC ); - +#endif if( m_canvas->IsMouseCaptured() ) { m_canvas->CallMouseCapture( aDC, aEvtPos, true ); } +#if 0 } +#endif } bool EDA_DRAW_FRAME::GeneralControlKeyMovement( int aHotKey, wxPoint *aPos, diff --git a/eeschema/controle.cpp b/eeschema/controle.cpp index d69bf1719c..ac8c868927 100644 --- a/eeschema/controle.cpp +++ b/eeschema/controle.cpp @@ -256,10 +256,12 @@ bool SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KE if( GetToolId() == ID_NO_TOOL_SELECTED ) m_canvas->CrossHairOff( aDC ); else - { - SetCrossHairPosition( pos, snapToGrid ); - RefreshCrossHair( oldpos, aPosition, aDC ); - } + m_canvas->CrossHairOn( aDC ); + + SetCrossHairPosition( pos, snapToGrid ); + + if( m_canvas->IsMouseCaptured() ) + m_canvas->CallMouseCapture( aDC, aPosition, true ); if( aHotKey ) {