Allow items to be moved from all anchor points
A change in commit 5731000135
caused kicad to stop allowing users
to move items like footprints, arcs and lines using anchors other
than the center point.
This was caused by the new code that stores reference points for
clipboard pasting, a call to updateModificationPoint() prevented
some old code paths from executing, which caused the selection to
snap into the cursor, always using the center anchor.
This fix moves the call within the if-cases that need it, and adds
a ClearReferencePoint call when the selection is "dropped" to allow
the user to grab the same selection again from a different anchor.
Fixes: lp:1722512
* https://bugs.launchpad.net/kicad/+bug/1722512
This commit is contained in:
parent
78366f8f0b
commit
3d2b5e3922
|
@ -450,8 +450,6 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
m_cursor = controls->GetCursorPosition();
|
m_cursor = controls->GetCursorPosition();
|
||||||
|
|
||||||
updateModificationPoint( selection );
|
|
||||||
|
|
||||||
if ( selection.HasReferencePoint() )
|
if ( selection.HasReferencePoint() )
|
||||||
{
|
{
|
||||||
// start moving with the reference point attached to the cursor
|
// start moving with the reference point attached to the cursor
|
||||||
|
@ -469,11 +467,13 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// Set the current cursor position to the first dragged item origin, so the
|
// Set the current cursor position to the first dragged item origin, so the
|
||||||
// movement vector could be computed later
|
// movement vector could be computed later
|
||||||
|
updateModificationPoint( selection );
|
||||||
m_cursor = grid.BestDragOrigin( originalCursorPos, curr_item );
|
m_cursor = grid.BestDragOrigin( originalCursorPos, curr_item );
|
||||||
grid.SetAuxAxes( true, m_cursor );
|
grid.SetAuxAxes( true, m_cursor );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
updateModificationPoint( selection );
|
||||||
m_cursor = grid.Align( m_cursor );
|
m_cursor = grid.Align( m_cursor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,6 +556,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
controls->SetAutoPan( false );
|
controls->SetAutoPan( false );
|
||||||
|
|
||||||
m_dragging = false;
|
m_dragging = false;
|
||||||
|
// Discard reference point when selection is "dropped" onto the board (ie: not dragging anymore)
|
||||||
|
selection.ClearReferencePoint();
|
||||||
|
|
||||||
if( unselect || restore )
|
if( unselect || restore )
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||||
|
|
Loading…
Reference in New Issue