From ee465fb23c061f3bd8f2410734c77d102a4c0c99 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 24 Sep 2018 14:29:23 -0700 Subject: [PATCH] pcbnew: Fixup for edde02481 to enable aux axis Correcting edde02481 which had side effects to efdbc91e42fcd19a4308336fe257922d860f216c while dragging a line but not a zone. --- pcbnew/tools/point_editor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index 6b23558fa4..4a37125053 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 @@ -305,6 +306,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() ); @@ -347,6 +350,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) m_original = *m_editedPoint; // Save the original position controls->SetAutoPan( true ); modified = true; + grid.SetAuxAxes( true, m_original.GetPosition(), true ); } bool enableAltConstraint = !!evt->Modifier( MD_CTRL ); @@ -358,8 +362,10 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) if( m_altConstraint ) m_altConstraint->Apply(); + else + m_editedPoint->ApplyConstraint(); - m_editedPoint->ApplyConstraint(); + m_editedPoint->SetPosition( grid.Align( m_editedPoint->GetPosition() ) ); updateItem(); updatePoints(); }