7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 18:19:17 +00:00

Snaps: prevent tiny snap line inhibiting extension lines

This commit is contained in:
John Beard 2024-10-04 11:01:23 +01:00
parent 9060292cd0
commit bc9b908de5

View File

@ -68,7 +68,11 @@ void CONSTRUCTION_GEOM::ViewDraw( int aLayer, VIEW* aView ) const
const BOX2I viewport = BOX2ISafe( aView->GetViewport() );
const bool haveSnapLine = m_snapLine && m_snapLine->Length() != 0;
// Prevents extremely short snap lines from inhibiting drawing
// These can happen due to rounding in intersections, etc.
// (usually it is length 1 IU)
const int minSnapLineLength = 10;
const bool haveSnapLine = m_snapLine && m_snapLine->Length() >= minSnapLineLength;
// Avoid fighting with the snap line
const auto drawLineIfNotAlsoSnapLine = [&]( const SEG& aLine )