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;
|
int w2 = aSeg->Width() / 2;
|
||||||
|
|
||||||
m_draggedLine = m_world->AssembleLine( aSeg, &m_draggedSegmentIndex );
|
m_draggedLine = m_world->AssembleLine( aSeg, &m_draggedSegmentIndex );
|
||||||
|
m_lastDragSolution = m_draggedLine;
|
||||||
|
|
||||||
if( m_shove )
|
if( m_shove )
|
||||||
{
|
{
|
||||||
|
@ -518,6 +519,7 @@ bool DRAGGER::dragWalkaround( const VECTOR2I& aP )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DRAGGER::dragShove( const VECTOR2I& aP )
|
bool DRAGGER::dragShove( const VECTOR2I& aP )
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
@ -560,8 +562,13 @@ bool DRAGGER::dragShove( const VECTOR2I& aP )
|
||||||
VECTOR2D lockV;
|
VECTOR2D lockV;
|
||||||
dragged.ClearLinks();
|
dragged.ClearLinks();
|
||||||
dragged.Unmark();
|
dragged.Unmark();
|
||||||
|
|
||||||
optimizeAndUpdateDraggedLine( dragged, m_draggedLine, aP );
|
optimizeAndUpdateDraggedLine( dragged, m_draggedLine, aP );
|
||||||
|
m_lastDragSolution = dragged;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_lastDragSolution.ClearLinks();
|
||||||
|
m_lastNode->Add( m_lastDragSolution );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -134,6 +134,7 @@ private:
|
||||||
NODE* m_lastNode;
|
NODE* m_lastNode;
|
||||||
int m_mode;
|
int m_mode;
|
||||||
LINE m_draggedLine;
|
LINE m_draggedLine;
|
||||||
|
LINE m_lastDragSolution;
|
||||||
std::unique_ptr<SHOVE> m_shove;
|
std::unique_ptr<SHOVE> m_shove;
|
||||||
int m_draggedSegmentIndex;
|
int m_draggedSegmentIndex;
|
||||||
bool m_dragStatus;
|
bool m_dragStatus;
|
||||||
|
|
Loading…
Reference in New Issue