pcbnew: Ensure cursor remains set during tool activity
Mouse capture end is called by some actions such as save board. This resets the cursor image but doesn't change the current tool. Resetting the cursor image during action prevents this.
This commit is contained in:
parent
dd93f89931
commit
35e87128f5
|
@ -233,6 +233,9 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
|
|||
|
||||
while( drawSegment( S_SEGMENT, line, startingPoint ) )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( line )
|
||||
{
|
||||
if( m_editModules )
|
||||
|
@ -272,6 +275,9 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
|
|||
|
||||
while( drawSegment( S_CIRCLE, circle ) )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( circle )
|
||||
{
|
||||
if( m_editModules )
|
||||
|
@ -306,6 +312,9 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
|
|||
|
||||
while( drawArc( arc ) )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( arc )
|
||||
{
|
||||
if( m_editModules )
|
||||
|
@ -351,6 +360,8 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
|||
// Main loop: keep receiving events
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
VECTOR2I cursorPos = m_controls->GetCursorPosition();
|
||||
|
||||
if( reselect && text )
|
||||
|
@ -532,6 +543,8 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
|||
// Main loop: keep receiving events
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
m_controls->SetSnapping( !evt->Modifier( MD_ALT ) );
|
||||
|
@ -908,6 +921,9 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
|||
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( evt->IsClick( BUT_LEFT ) )
|
||||
{
|
||||
MODULE* module = (MODULE*) m_frame->GetModel();
|
||||
|
@ -1386,6 +1402,8 @@ int DRAWING_TOOL::drawZone( bool aKeepout, ZONE_MODE aMode )
|
|||
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
LSET layers( m_frame->GetActiveLayer() );
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
|
|
|
@ -1328,6 +1328,8 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
|||
|
||||
while( auto evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
frame()->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
controls.SetSnapping( !evt->Modifier( MD_ALT ) );
|
||||
|
|
|
@ -453,6 +453,8 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
|
|||
// Main loop: keep receiving events
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
cursorPos = controls->GetCursorPosition( !evt->Modifier( MD_ALT ) );
|
||||
|
||||
if( reselect && module )
|
||||
|
@ -629,6 +631,8 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
|
|||
// Main loop: keep receiving events
|
||||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
cursorPos = controls->GetCursorPosition( !evt->Modifier( MD_ALT ) );
|
||||
|
||||
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||
|
|
Loading…
Reference in New Issue