Update cross hairshape (GAL).
This commit is contained in:
parent
a43a288e10
commit
37db33cbca
|
@ -331,6 +331,9 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent )
|
||||||
|
|
||||||
void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent )
|
void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
|
if( aEvent.IsChecked() != m_cursorShape && IsGalCanvasActive() )
|
||||||
|
GetToolManager()->RunAction( "pcbnew.Control.switchCursor" );
|
||||||
|
|
||||||
aEvent.Check( m_cursorShape );
|
aEvent.Check( m_cursorShape );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1043,6 +1046,8 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
|
||||||
gal->SetGridVisibility( IsGridVisible() );
|
gal->SetGridVisibility( IsGridVisible() );
|
||||||
gal->SetGridSize( VECTOR2D( screen->GetGridSize() ) );
|
gal->SetGridSize( VECTOR2D( screen->GetGridSize() ) );
|
||||||
gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) );
|
gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) );
|
||||||
|
|
||||||
|
GetToolManager()->RunAction( "pcbnew.Control.switchCursor" );
|
||||||
}
|
}
|
||||||
else // Switch to standard rendering
|
else // Switch to standard rendering
|
||||||
{
|
{
|
||||||
|
|
|
@ -644,9 +644,6 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
|
||||||
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
|
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
|
||||||
return COMMON_ACTIONS::highContrastMode.MakeEvent();
|
return COMMON_ACTIONS::highContrastMode.MakeEvent();
|
||||||
|
|
||||||
case ID_TB_OPTIONS_SELECT_CURSOR:
|
|
||||||
return COMMON_ACTIONS::switchCursor.MakeEvent();
|
|
||||||
|
|
||||||
case ID_FIND_ITEMS:
|
case ID_FIND_ITEMS:
|
||||||
return COMMON_ACTIONS::find.MakeEvent();
|
return COMMON_ACTIONS::find.MakeEvent();
|
||||||
|
|
||||||
|
|
|
@ -509,15 +509,12 @@ int PCBNEW_CONTROL::ResetCoords( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int PCBNEW_CONTROL::SwitchCursor( 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;
|
const unsigned int SMALL_CURSOR = 80;
|
||||||
|
|
||||||
KIGFX::GAL* gal = getEditFrame<PCB_BASE_FRAME>()->GetGalCanvas()->GetGAL();
|
PCB_BASE_FRAME* frame = getEditFrame<PCB_BASE_FRAME>();
|
||||||
|
KIGFX::GAL* gal = frame->GetGalCanvas()->GetGAL();
|
||||||
if( gal->GetCursorSize() == BIG_CURSOR )
|
gal->SetCursorSize( frame->GetCursorShape() ? BIG_CURSOR : SMALL_CURSOR );
|
||||||
gal->SetCursorSize( SMALL_CURSOR );
|
|
||||||
else
|
|
||||||
gal->SetCursorSize( BIG_CURSOR );
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue