From edde02481e035843889d8a66f04c24ff8600d010 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 24 Sep 2018 14:03:54 -0700 Subject: [PATCH] pcbnew: Fix alignment with off-grid drag Commit efdbc91e42fcd19a4308336fe257922d860f216c broken the primary alignment mechanism for maintaining the current point as an auxilliary grid reference. This reverts that commit and fixes both the initial issue and the associated bug by applying the primary constraint after the secondary. In this way, we consider the secondary constraint as an additive rather than alternative constraint. Fixes: lp:1793888 * https://bugs.launchpad.net/kicad/+bug/1793888 --- pcbnew/tools/point_editor.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index 34abc0790d..6b23558fa4 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -34,7 +34,6 @@ using namespace std::placeholders; #include "pcb_actions.h" #include "selection_tool.h" #include "point_editor.h" -#include "grid_helper.h" #include #include #include @@ -306,8 +305,6 @@ 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() ); @@ -361,10 +358,8 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) if( m_altConstraint ) m_altConstraint->Apply(); - else - m_editedPoint->ApplyConstraint(); - m_editedPoint->SetPosition( grid.Align( m_editedPoint->GetPosition() ) ); + m_editedPoint->ApplyConstraint(); updateItem(); updatePoints(); }