@@ -463,10 +463,22 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,
463463
464464void GraphicsWindow::ClearPending () {
465465 pending.points .Clear ();
466+ pending.requests .Clear ();
466467 pending = {};
467468 SS.ScheduleShowTW ();
468469}
469470
471+ bool GraphicsWindow::IsFromPending (hRequest r) {
472+ for (auto &req : pending.requests ) {
473+ if (req.v == r.v ) return true ;
474+ }
475+ return false ;
476+ }
477+
478+ void GraphicsWindow::AddToPending (hRequest r) {
479+ pending.requests .Add (&r);
480+ }
481+
470482void GraphicsWindow::MouseMiddleOrRightDown (double x, double y) {
471483 if (GraphicsEditControlIsVisible ()) return ;
472484
@@ -936,6 +948,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
936948 case Command::LINE_SEGMENT:
937949 case Command::CONSTR_SEGMENT:
938950 hr = AddRequest (Request::Type::LINE_SEGMENT);
951+ AddToPending (hr);
939952 SK.GetRequest (hr)->construction = (pending.command == Command::CONSTR_SEGMENT);
940953 SK.GetEntity (hr.entity (1 ))->PointForceTo (v);
941954 ConstrainPointByHovered (hr.entity (1 ));
@@ -961,6 +974,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
961974 SS.UndoRemember ();
962975 for (i = 0 ; i < 4 ; i++) {
963976 lns[i] = AddRequest (Request::Type::LINE_SEGMENT, /* rememberForUndo=*/ false );
977+ AddToPending (lns[i]);
964978 }
965979 for (i = 0 ; i < 4 ; i++) {
966980 Constraint::ConstrainCoincident (
@@ -1009,6 +1023,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
10091023 break ;
10101024 }
10111025 hr = AddRequest (Request::Type::ARC_OF_CIRCLE);
1026+ AddToPending (hr);
10121027 // This fudge factor stops us from immediately failing to solve
10131028 // because of the arc's implicit (equal radius) tangent.
10141029 Vector adj = SS.GW .projRight .WithMagnitude (2 /SS.GW .scale );
@@ -1026,6 +1041,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
10261041 }
10271042 case Command::CUBIC:
10281043 hr = AddRequest (Request::Type::CUBIC);
1044+ AddToPending (hr);
10291045 SK.GetEntity (hr.entity (1 ))->PointForceTo (v);
10301046 SK.GetEntity (hr.entity (2 ))->PointForceTo (v);
10311047 SK.GetEntity (hr.entity (3 ))->PointForceTo (v);
0 commit comments