Allow point editor to persist
After drawing a graphic, allow the control points to persist when exiting the tool. The effect of this is to make the first "Esc" press a "return-to-select-tool" event without modifying the selection or control points from within the drawing tools. The section "Esc" press, when in the selection tool will clear the selection and the control points
This commit is contained in:
parent
5c9a73aa5e
commit
ba73456d49
|
@ -1423,6 +1423,8 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, PCB_SHAPE** aGraphic,
|
||||||
|
|
||||||
if( !started )
|
if( !started )
|
||||||
{
|
{
|
||||||
|
// We've handled the cancel event. Don't cancel other tools
|
||||||
|
evt->SetPassEvent( false );
|
||||||
m_frame->PopTool( aTool );
|
m_frame->PopTool( aTool );
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
}
|
}
|
||||||
|
@ -1741,6 +1743,8 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool
|
||||||
|
|
||||||
if( !firstPoint )
|
if( !firstPoint )
|
||||||
{
|
{
|
||||||
|
// We've handled the cancel event. Don't cancel other tools
|
||||||
|
evt->SetPassEvent( false );
|
||||||
m_frame->PopTool( aTool );
|
m_frame->PopTool( aTool );
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
}
|
}
|
||||||
|
@ -2060,6 +2064,8 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// We've handled the cancel event. Don't cancel other tools
|
||||||
|
evt->SetPassEvent( false );
|
||||||
m_frame->PopTool( tool );
|
m_frame->PopTool( tool );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,11 +548,10 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
||||||
inDrag = false;
|
inDrag = false;
|
||||||
frame()->UndoRedoBlock( false );
|
frame()->UndoRedoBlock( false );
|
||||||
}
|
}
|
||||||
else if( evt->IsCancelInteractive() )
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Only cancel point editor when activating a new tool
|
||||||
|
// Otherwise, allow the points to persist when moving up the
|
||||||
|
// tool stack
|
||||||
if( evt->IsActivate() && !evt->IsMoveTool() )
|
if( evt->IsActivate() && !evt->IsMoveTool() )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue