eeschema: move part by a point on the grid (lp:1563587)
This commit is contained in:
parent
fd3835eb4f
commit
5ff3bbb96e
|
@ -796,7 +796,15 @@ void SCH_EDIT_FRAME::PrepareMoveItem( SCH_ITEM* aItem, wxDC* aDC )
|
|||
aItem->SetStoredPos( wxPoint( 0,0 ) );
|
||||
}
|
||||
else
|
||||
aItem->SetStoredPos( GetCrossHairPosition() - aItem->GetPosition() );
|
||||
{
|
||||
// Round the point under the cursor to a multiple of the grid
|
||||
wxPoint cursorpos = GetCrossHairPosition() - aItem->GetPosition();
|
||||
wxPoint gridsize = GetScreen()->GetGridSize();
|
||||
cursorpos.x = ( cursorpos.x / gridsize.x ) * gridsize.x;
|
||||
cursorpos.y = ( cursorpos.y / gridsize.y ) * gridsize.y;
|
||||
|
||||
aItem->SetStoredPos( cursorpos );
|
||||
}
|
||||
|
||||
OnModify();
|
||||
|
||||
|
|
Loading…
Reference in New Issue