diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index a593bc9d4a..a7fe7722a4 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -34,6 +34,7 @@ using namespace std::placeholders; #include "pcb_actions.h" #include "selection_tool.h" #include "point_editor.h" +#include "grid_helper.h" #include #include #include @@ -288,6 +289,8 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) KIGFX::VIEW_CONTROLS* controls = getViewControls(); KIGFX::VIEW* view = getView(); PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); + + GRID_HELPER grid( editFrame ); auto item = selection.Front(); m_editPoints = EDIT_POINTS_FACTORY::Make( item, getView()->GetGAL() ); @@ -344,6 +347,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) else m_editedPoint->ApplyConstraint(); + m_editedPoint->SetPosition( grid.Align( m_editedPoint->GetPosition() ) ); updateItem(); updatePoints(); }