@@ -485,6 +485,14 @@ void GraphicsWindow::AddToPending(hRequest r) {
485485 pending.requests .Add (&r);
486486}
487487
488+ void GraphicsWindow::ReplacePending (hRequest before, hRequest after) {
489+ for (auto &req : pending.requests ) {
490+ if (req.v == before.v ) {
491+ req.v = after.v ;
492+ }
493+ }
494+ }
495+
488496void GraphicsWindow::MouseMiddleOrRightDown (double x, double y) {
489497 if (GraphicsEditControlIsVisible ()) return ;
490498
@@ -956,12 +964,12 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
956964 case Command::LINE_SEGMENT:
957965 case Command::CONSTR_SEGMENT:
958966 hr = AddRequest (Request::Type::LINE_SEGMENT);
959- AddToPending (hr);
960967 SK.GetRequest (hr)->construction = (pending.command == Command::CONSTR_SEGMENT);
961968 SK.GetEntity (hr.entity (1 ))->PointForceTo (v);
962969 ConstrainPointByHovered (hr.entity (1 ));
963970
964971 ClearSuper ();
972+ AddToPending (hr);
965973
966974 pending.operation = Pending::DRAGGING_NEW_LINE_POINT;
967975 pending.request = hr;
@@ -1037,7 +1045,6 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
10371045 break ;
10381046 }
10391047 hr = AddRequest (Request::Type::ARC_OF_CIRCLE);
1040- AddToPending (hr);
10411048 // This fudge factor stops us from immediately failing to solve
10421049 // because of the arc's implicit (equal radius) tangent.
10431050 Vector adj = SS.GW .projRight .WithMagnitude (2 /SS.GW .scale );
@@ -1047,6 +1054,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
10471054 ConstrainPointByHovered (hr.entity (2 ));
10481055
10491056 ClearSuper ();
1057+ AddToPending (hr);
10501058
10511059 pending.operation = Pending::DRAGGING_NEW_ARC_POINT;
10521060 pending.point = hr.entity (3 );
@@ -1055,14 +1063,14 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
10551063 }
10561064 case Command::CUBIC:
10571065 hr = AddRequest (Request::Type::CUBIC);
1058- AddToPending (hr);
10591066 SK.GetEntity (hr.entity (1 ))->PointForceTo (v);
10601067 SK.GetEntity (hr.entity (2 ))->PointForceTo (v);
10611068 SK.GetEntity (hr.entity (3 ))->PointForceTo (v);
10621069 SK.GetEntity (hr.entity (4 ))->PointForceTo (v);
10631070 ConstrainPointByHovered (hr.entity (1 ));
10641071
10651072 ClearSuper ();
1073+ AddToPending (hr);
10661074
10671075 pending.operation = Pending::DRAGGING_NEW_CUBIC_POINT;
10681076 pending.point = hr.entity (4 );
@@ -1093,6 +1101,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
10931101 break ;
10941102 }
10951103 hr = AddRequest (Request::Type::TTF_TEXT);
1104+ AddToPending (hr);
10961105 Request *r = SK.GetRequest (hr);
10971106 r->str = " Abc" ;
10981107 r->font = " arial.ttf" ;
@@ -1211,6 +1220,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
12111220
12121221 // Create a new line segment, so that we continue drawing.
12131222 hRequest hr = AddRequest (Request::Type::LINE_SEGMENT);
1223+ ReplacePending (pending.request , hr);
12141224 SK.GetRequest (hr)->construction = SK.GetRequest (pending.request )->construction ;
12151225 SK.GetEntity (hr.entity (1 ))->PointForceTo (v);
12161226 // Displace the second point of the new line segment slightly,
0 commit comments