pcbnew: Get anchor from layer when drawing
When drawing segments, the segment will be NULL'd after committing, at which point we lost our snap layer. Choosing snap layers from the current drawing layer is a more robust method. Fixes: lp:1796467 * https://bugs.launchpad.net/kicad/+bug/1796467
This commit is contained in:
parent
86999a2a4d
commit
f2a49c6bd6
|
@ -1023,7 +1023,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
|
|||
{
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
cursorPos = grid.BestSnapAnchor( m_controls->GetCursorPosition(), aGraphic );
|
||||
cursorPos = grid.BestSnapAnchor( m_controls->GetCursorPosition(), getDrawingLayer() );
|
||||
|
||||
// 45 degree angle constraint enabled with an option and toggled with Ctrl
|
||||
const bool limit45 = ( frame()->Settings().m_use45DegreeGraphicSegments != !!( evt->Modifier( MD_CTRL ) ) );
|
||||
|
|
Loading…
Reference in New Issue