Commit 4068d6c8 authored by Maciej Suminski's avatar Maciej Suminski

Selection tool uses the real drag origin to compute offset when dragging items.

parent b8fd1de7
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
#include <view/view_controls.h> #include <view/view_controls.h>
#include <gal/graphics_abstraction_layer.h>
#include <ratsnest_data.h> #include <ratsnest_data.h>
#include <confirm.h> #include <confirm.h>
...@@ -175,9 +176,11 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent ) ...@@ -175,9 +176,11 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
} }
else else
{ {
const VECTOR2D& dragOrigin = getView()->GetGAL()->GetGridPoint( evt->DragOrigin() );
// Update dragging offset (distance between cursor and the first dragged item) // Update dragging offset (distance between cursor and the first dragged item)
m_offset = static_cast<BOARD_ITEM*>( selection.items.GetPickedItem( 0 ) )->GetPosition() - m_offset = static_cast<BOARD_ITEM*>( selection.items.GetPickedItem( 0 ) )->GetPosition() -
wxPoint( m_cursor.x, m_cursor.y ); wxPoint( dragOrigin.x, dragOrigin.y );
} }
m_dragging = true; m_dragging = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment