Commit 3e9bb6b8 authored by Maciej Suminski's avatar Maciej Suminski

SELECTION::GetCenter() returns VECTOR2I instead of wxPoint.

parent c2bd2491
...@@ -618,7 +618,8 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) ...@@ -618,7 +618,8 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED );
} }
wxPoint rotPoint = selection.GetCenter(); VECTOR2I rp = selection.GetCenter();
wxPoint rotPoint( rp.x, rp.y );
for( unsigned int i = 0; i < selection.items.GetCount(); ++i ) for( unsigned int i = 0; i < selection.items.GetCount(); ++i )
{ {
...@@ -769,7 +770,8 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent ) ...@@ -769,7 +770,8 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL; DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL;
const wxPoint rotPoint = selection.GetCenter(); VECTOR2I rp = selection.GetCenter();
const wxPoint rotPoint( rp.x, rp.y );
DIALOG_CREATE_ARRAY dialog( editFrame, rotPoint, &array_opts ); DIALOG_CREATE_ARRAY dialog( editFrame, rotPoint, &array_opts );
int ret = dialog.ShowModal(); int ret = dialog.ShowModal();
......
...@@ -931,9 +931,9 @@ void SELECTION::clear() ...@@ -931,9 +931,9 @@ void SELECTION::clear()
} }
wxPoint SELECTION::GetCenter() const VECTOR2I SELECTION::GetCenter() const
{ {
wxPoint centre; VECTOR2I centre;
if( Size() == 1 ) if( Size() == 1 )
{ {
......
...@@ -70,7 +70,7 @@ struct SELECTION ...@@ -70,7 +70,7 @@ struct SELECTION
return static_cast<T*>( items.GetPickedItem( aIndex ) ); return static_cast<T*>( items.GetPickedItem( aIndex ) );
} }
wxPoint GetCenter() const; VECTOR2I GetCenter() const;
private: private:
/// Clears both the VIEW_GROUP and set of selected items. Please note that it does not /// Clears both the VIEW_GROUP and set of selected items. Please note that it does not
......
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