From 37db33cbca3d8e596de80b0218e1ad0bc90a7338 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 26 Jun 2015 17:30:41 +0200 Subject: [PATCH] Update cross hairshape (GAL). --- common/draw_frame.cpp | 5 +++++ pcbnew/tools/common_actions.cpp | 3 --- pcbnew/tools/pcbnew_control.cpp | 11 ++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/common/draw_frame.cpp b/common/draw_frame.cpp index 3c52a7fea5..37fc1b3106 100644 --- a/common/draw_frame.cpp +++ b/common/draw_frame.cpp @@ -331,6 +331,9 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent ) void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent ) { + if( aEvent.IsChecked() != m_cursorShape && IsGalCanvasActive() ) + GetToolManager()->RunAction( "pcbnew.Control.switchCursor" ); + aEvent.Check( m_cursorShape ); } @@ -1043,6 +1046,8 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable ) gal->SetGridVisibility( IsGridVisible() ); gal->SetGridSize( VECTOR2D( screen->GetGridSize() ) ); gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) ); + + GetToolManager()->RunAction( "pcbnew.Control.switchCursor" ); } else // Switch to standard rendering { diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 2820fcc9a0..dc60be456c 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -644,9 +644,6 @@ boost::optional COMMON_ACTIONS::TranslateLegacyId( int aId ) case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE: return COMMON_ACTIONS::highContrastMode.MakeEvent(); - case ID_TB_OPTIONS_SELECT_CURSOR: - return COMMON_ACTIONS::switchCursor.MakeEvent(); - case ID_FIND_ITEMS: return COMMON_ACTIONS::find.MakeEvent(); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index a1d8e9b9cc..a30a8642f0 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -509,15 +509,12 @@ int PCBNEW_CONTROL::ResetCoords( const TOOL_EVENT& aEvent ) int PCBNEW_CONTROL::SwitchCursor( const TOOL_EVENT& aEvent ) { - const unsigned int BIG_CURSOR = 4000; + const unsigned int BIG_CURSOR = 8000; const unsigned int SMALL_CURSOR = 80; - KIGFX::GAL* gal = getEditFrame()->GetGalCanvas()->GetGAL(); - - if( gal->GetCursorSize() == BIG_CURSOR ) - gal->SetCursorSize( SMALL_CURSOR ); - else - gal->SetCursorSize( BIG_CURSOR ); + PCB_BASE_FRAME* frame = getEditFrame(); + KIGFX::GAL* gal = frame->GetGalCanvas()->GetGAL(); + gal->SetCursorSize( frame->GetCursorShape() ? BIG_CURSOR : SMALL_CURSOR ); return 0; }