Get consistent point for gfx import
TopLeftItem() should always return same element for our import Fixes https://gitlab.com/kicad/code/kicad/issues/13041
This commit is contained in:
parent
cf33f33899
commit
b31349b679
|
@ -1602,7 +1602,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
|||
|
||||
// Now move the new items to the current cursor position:
|
||||
VECTOR2I cursorPos = m_controls->GetCursorPosition( !aEvent.DisableGridSnapping() );
|
||||
VECTOR2I delta = cursorPos - static_cast<BOARD_ITEM*>( preview.Front() )->GetPosition();
|
||||
VECTOR2I delta = cursorPos - static_cast<BOARD_ITEM*>( preview.GetTopLeftItem() )->GetPosition();
|
||||
|
||||
for( BOARD_ITEM* item : selectedItems )
|
||||
item->Move( delta );
|
||||
|
@ -1638,7 +1638,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else if( evt->IsMotion() )
|
||||
{
|
||||
delta = cursorPos - static_cast<BOARD_ITEM*>( preview.Front() )->GetPosition();
|
||||
delta = cursorPos - static_cast<BOARD_ITEM*>( preview.GetTopLeftItem() )->GetPosition();
|
||||
|
||||
for( BOARD_ITEM* item : selectedItems )
|
||||
item->Move( delta );
|
||||
|
|
Loading…
Reference in New Issue