pcbnew: Fix alignment with off-grid drag
Commitefdbc91e42broken 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 (cherry picked from commitedde02481e)
This commit is contained in:
@@ -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 <board_commit.h>
|
||||
#include <bitmaps.h>
|
||||
#include <status_popup.h>
|
||||
@@ -289,8 +288,6 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
||||
KIGFX::VIEW_CONTROLS* controls = getViewControls();
|
||||
KIGFX::VIEW* view = getView();
|
||||
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
||||
|
||||
GRID_HELPER grid( editFrame );
|
||||
auto item = selection.Front();
|
||||
|
||||
m_editPoints = EDIT_POINTS_FACTORY::Make( item, getView()->GetGAL() );
|
||||
@@ -344,10 +341,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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user