PNS: Keep last valid drag solution in the node
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5450
This commit is contained in:
parent
26835f582c
commit
d4957b112e
|
@ -70,6 +70,7 @@ bool DRAGGER::startDragSegment( const VECTOR2D& aP, SEGMENT* aSeg )
|
|||
int w2 = aSeg->Width() / 2;
|
||||
|
||||
m_draggedLine = m_world->AssembleLine( aSeg, &m_draggedSegmentIndex );
|
||||
m_lastDragSolution = m_draggedLine;
|
||||
|
||||
if( m_shove )
|
||||
{
|
||||
|
@ -518,6 +519,7 @@ bool DRAGGER::dragWalkaround( const VECTOR2I& aP )
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool DRAGGER::dragShove( const VECTOR2I& aP )
|
||||
{
|
||||
bool ok = false;
|
||||
|
@ -560,8 +562,13 @@ bool DRAGGER::dragShove( const VECTOR2I& aP )
|
|||
VECTOR2D lockV;
|
||||
dragged.ClearLinks();
|
||||
dragged.Unmark();
|
||||
|
||||
optimizeAndUpdateDraggedLine( dragged, m_draggedLine, aP );
|
||||
m_lastDragSolution = dragged;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lastDragSolution.ClearLinks();
|
||||
m_lastNode->Add( m_lastDragSolution );
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -134,6 +134,7 @@ private:
|
|||
NODE* m_lastNode;
|
||||
int m_mode;
|
||||
LINE m_draggedLine;
|
||||
LINE m_lastDragSolution;
|
||||
std::unique_ptr<SHOVE> m_shove;
|
||||
int m_draggedSegmentIndex;
|
||||
bool m_dragStatus;
|
||||
|
|
Loading…
Reference in New Issue