Don't allow IS_NEW flag on created-line-segments to fool us.

When dragging we'll create new line segments between selection-edge
objects and things outside the selection that they're attached to.
These new lines have their IS_NEW flags set, but shouldn't fool us
into thinking that the selection contains pasted (or placed) items.
This commit is contained in:
Jeff Young 2019-12-28 00:29:41 +00:00
parent 9d0198bade
commit e85701f405
1 changed files with 2 additions and 1 deletions

View File

@ -179,6 +179,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
SCH_ITEM* sch_item = (SCH_ITEM*) selection.Front();
bool appendUndo = sch_item && sch_item->IsNew();
bool placingNewItems = sch_item->IsNew();
//------------------------------------------------------------------------
// Setup a drag or a move
@ -268,7 +269,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
wxASSERT_MSG( m_anchorPos, "Should be already set from previous cmd" );
}
else if( selection.Front()->HasFlag( IS_NEW ) )
else if( placingNewItems )
{
m_anchorPos = selection.GetReferencePoint();
}