PNS router: apply the last stable state after dragging
Previously, dragging changes were applied only if the last cursor move finished with a successful drag operation. It made items squeezing difficult, as it required accurate cursor movement to apply the changes.
This commit is contained in:
parent
471e3de5a7
commit
2b46bda2f2
|
@ -149,11 +149,13 @@ bool DRAGGER::Start( const VECTOR2I& aP, ITEM* aStartItem )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void DRAGGER::SetMode( int aMode )
|
||||
{
|
||||
m_mode = aMode;
|
||||
}
|
||||
|
||||
|
||||
bool DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
|
||||
{
|
||||
if( m_lastNode )
|
||||
|
@ -301,6 +303,7 @@ bool DRAGGER::dragShove( const VECTOR2I& aP )
|
|||
{
|
||||
if( newVia )
|
||||
m_draggedVia = newVia;
|
||||
|
||||
m_draggedItems.Clear();
|
||||
}
|
||||
|
||||
|
@ -316,9 +319,11 @@ bool DRAGGER::dragShove( const VECTOR2I& aP )
|
|||
|
||||
bool DRAGGER::FixRoute()
|
||||
{
|
||||
if( m_dragStatus )
|
||||
NODE* node = CurrentNode();
|
||||
|
||||
if( node )
|
||||
{
|
||||
Router()->CommitRouting( CurrentNode() );
|
||||
Router()->CommitRouting( node );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue