From c74ab47833ffd51599b10bee122cc1adde32180b Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Thu, 3 Dec 2009 11:47:44 -0800 Subject: [PATCH] Don't create new line segments as zero-length when left-clicking to draw more line segments, to avoid annoying warnings. [git-p4: depot-paths = "//depot/solvespace/": change = 2083] --- mouse.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mouse.cpp b/mouse.cpp index 05bcb9a..e5f71b3 100644 --- a/mouse.cpp +++ b/mouse.cpp @@ -987,7 +987,10 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) { // Create a new line segment, so that we continue drawing. hRequest hr = AddRequest(Request::LINE_SEGMENT); SK.GetEntity(hr.entity(1))->PointForceTo(v); - SK.GetEntity(hr.entity(2))->PointForceTo(v); + // Displace the second point of the new line segment slightly, + // to avoid creating zero-length edge warnings. + SK.GetEntity(hr.entity(2))->PointForceTo( + v.Plus(projRight.ScaledBy(0.5/scale))); // Constrain the line segments to share an endpoint Constraint::ConstrainCoincident(pending.point, hr.entity(1));