diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 33fe9b5..806c32a 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -113,6 +113,7 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = { { 1, "&Workplane", MNU_WORKPLANE, 0, IN, mReq }, { 1, NULL, 0, 0, IN, NULL }, { 1, "Line &Segment", MNU_LINE_SEGMENT, 'S', IN, mReq }, +{ 1, "C&onstruction Line Segment", MNU_CONSTR_SEGMENT, S|'S', IN, mReq }, { 1, "&Rectangle", MNU_RECTANGLE, 'R', IN, mReq }, { 1, "&Circle", MNU_CIRCLE, 'C', IN, mReq }, { 1, "&Arc of a Circle", MNU_ARC, 'A', IN, mReq }, @@ -954,6 +955,7 @@ void GraphicsWindow::MenuRequest(int id) { case MNU_ARC: s = "click point on arc (draws anti-clockwise)"; goto c; case MNU_DATUM_POINT: s = "click to place datum point"; goto c; case MNU_LINE_SEGMENT: s = "click first point of line segment"; goto c; + case MNU_CONSTR_SEGMENT: s = "click first point of construction line segment"; goto c; case MNU_CUBIC: s = "click first point of cubic segment"; goto c; case MNU_CIRCLE: s = "click center of circle"; goto c; case MNU_WORKPLANE: s = "click origin of workplane"; goto c; diff --git a/src/mouse.cpp b/src/mouse.cpp index 08cbf72..9803be9 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -808,7 +808,9 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) { break; case MNU_LINE_SEGMENT: + case MNU_CONSTR_SEGMENT: hr = AddRequest(Request::LINE_SEGMENT); + SK.GetRequest(hr)->construction = (pending.operation == MNU_CONSTR_SEGMENT); SK.GetEntity(hr.entity(1))->PointForceTo(v); ConstrainPointByHovered(hr.entity(1)); @@ -1051,6 +1053,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) { // Create a new line segment, so that we continue drawing. hRequest hr = AddRequest(Request::LINE_SEGMENT); + SK.GetRequest(hr)->construction = SK.GetRequest(pending.request)->construction; SK.GetEntity(hr.entity(1))->PointForceTo(v); // Displace the second point of the new line segment slightly, // to avoid creating zero-length edge warnings. diff --git a/src/ui.h b/src/ui.h index 42d727e..0bb59e7 100644 --- a/src/ui.h +++ b/src/ui.h @@ -377,6 +377,7 @@ public: MNU_DATUM_POINT, MNU_WORKPLANE, MNU_LINE_SEGMENT, + MNU_CONSTR_SEGMENT, MNU_CIRCLE, MNU_ARC, MNU_RECTANGLE,