Update pointEditor after cancelled move.
This commit is contained in:
parent
5366fa8cee
commit
bb618f2d55
|
@ -749,26 +749,34 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference )
|
||||||
m_dragging = false;
|
m_dragging = false;
|
||||||
editFrame->UndoRedoBlock( false );
|
editFrame->UndoRedoBlock( false );
|
||||||
|
|
||||||
m_toolMgr->GetTool<DRAWING_TOOL>()->UpdateStatusBar();
|
|
||||||
|
|
||||||
if( hasRedrawn3D && restore_state )
|
|
||||||
editFrame->Update3DView( false, true );
|
|
||||||
|
|
||||||
// Discard reference point when selection is "dropped" onto the board
|
// Discard reference point when selection is "dropped" onto the board
|
||||||
selection.ClearReferencePoint();
|
selection.ClearReferencePoint();
|
||||||
|
|
||||||
// Unselect all items to clear selection flags and then re-select the originally selected
|
// Unselect all items to clear selection flags and then re-select the originally selected
|
||||||
// items.
|
// items (after the potential Revert()).
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
|
|
||||||
|
|
||||||
// TODO: there's an encapsulation leak here: this commit often has more than just the move
|
// TODO: there's an encapsulation leak here: this commit often has more than just the move
|
||||||
// in it; for instance it might have a paste, append board, etc. as well.
|
// in it; for instance it might have a paste, append board, etc. as well.
|
||||||
if( restore_state )
|
if( restore_state )
|
||||||
|
{
|
||||||
m_commit->Revert();
|
m_commit->Revert();
|
||||||
else
|
|
||||||
m_commit->Push( _( "Drag" ) );
|
|
||||||
|
|
||||||
|
// Mainly for point editor, but there might be other clients that need to adjust to
|
||||||
|
// reverted state.
|
||||||
|
m_toolMgr->PostEvent( EVENTS::SelectedItemsMoved );
|
||||||
|
|
||||||
|
if( hasRedrawn3D )
|
||||||
|
editFrame->Update3DView( false, true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_commit->Push( _( "Drag" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items );
|
||||||
|
|
||||||
|
m_toolMgr->GetTool<DRAWING_TOOL>()->UpdateStatusBar();
|
||||||
// Remove the dynamic ratsnest from the screen
|
// Remove the dynamic ratsnest from the screen
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true );
|
m_toolMgr->RunAction( PCB_ACTIONS::hideLocalRatsnest, true );
|
||||||
|
|
||||||
|
|
|
@ -2472,6 +2472,7 @@ void PCB_POINT_EDITOR::setTransitions()
|
||||||
Go( &PCB_POINT_EDITOR::addCorner, PCB_ACTIONS::pointEditorAddCorner.MakeEvent() );
|
Go( &PCB_POINT_EDITOR::addCorner, PCB_ACTIONS::pointEditorAddCorner.MakeEvent() );
|
||||||
Go( &PCB_POINT_EDITOR::removeCorner, PCB_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
|
Go( &PCB_POINT_EDITOR::removeCorner, PCB_ACTIONS::pointEditorRemoveCorner.MakeEvent() );
|
||||||
Go( &PCB_POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified );
|
Go( &PCB_POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsModified );
|
||||||
|
Go( &PCB_POINT_EDITOR::modifiedSelection, EVENTS::SelectedItemsMoved );
|
||||||
Go( &PCB_POINT_EDITOR::OnSelectionChange, EVENTS::PointSelectedEvent );
|
Go( &PCB_POINT_EDITOR::OnSelectionChange, EVENTS::PointSelectedEvent );
|
||||||
Go( &PCB_POINT_EDITOR::OnSelectionChange, EVENTS::SelectedEvent );
|
Go( &PCB_POINT_EDITOR::OnSelectionChange, EVENTS::SelectedEvent );
|
||||||
Go( &PCB_POINT_EDITOR::OnSelectionChange, EVENTS::UnselectedEvent );
|
Go( &PCB_POINT_EDITOR::OnSelectionChange, EVENTS::UnselectedEvent );
|
||||||
|
|
Loading…
Reference in New Issue