Do not hover or select entities from any pending request.
parent
96476ca2e5
commit
55ae10b5b8
|
@ -336,6 +336,10 @@ GraphicsWindow::Selection GraphicsWindow::ChooseFromHoverToSelect() {
|
||||||
for(const Hover &hov : hoverList) {
|
for(const Hover &hov : hoverList) {
|
||||||
hGroup hg = {};
|
hGroup hg = {};
|
||||||
if(hov.selection.entity.v != 0) {
|
if(hov.selection.entity.v != 0) {
|
||||||
|
hEntity he = hov.selection.entity;
|
||||||
|
if(he.isFromRequest() && IsFromPending(he.request())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
hg = SK.GetEntity(hov.selection.entity)->group;
|
hg = SK.GetEntity(hov.selection.entity)->group;
|
||||||
} else if(hov.selection.constraint.v != 0) {
|
} else if(hov.selection.constraint.v != 0) {
|
||||||
hg = SK.GetConstraint(hov.selection.constraint)->group;
|
hg = SK.GetConstraint(hov.selection.constraint)->group;
|
||||||
|
|
|
@ -463,10 +463,22 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,
|
||||||
|
|
||||||
void GraphicsWindow::ClearPending() {
|
void GraphicsWindow::ClearPending() {
|
||||||
pending.points.Clear();
|
pending.points.Clear();
|
||||||
|
pending.requests.Clear();
|
||||||
pending = {};
|
pending = {};
|
||||||
SS.ScheduleShowTW();
|
SS.ScheduleShowTW();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GraphicsWindow::IsFromPending(hRequest r) {
|
||||||
|
for(auto &req : pending.requests) {
|
||||||
|
if(req.v == r.v) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsWindow::AddToPending(hRequest r) {
|
||||||
|
pending.requests.Add(&r);
|
||||||
|
}
|
||||||
|
|
||||||
void GraphicsWindow::MouseMiddleOrRightDown(double x, double y) {
|
void GraphicsWindow::MouseMiddleOrRightDown(double x, double y) {
|
||||||
if(GraphicsEditControlIsVisible()) return;
|
if(GraphicsEditControlIsVisible()) return;
|
||||||
|
|
||||||
|
@ -936,6 +948,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
|
||||||
case Command::LINE_SEGMENT:
|
case Command::LINE_SEGMENT:
|
||||||
case Command::CONSTR_SEGMENT:
|
case Command::CONSTR_SEGMENT:
|
||||||
hr = AddRequest(Request::Type::LINE_SEGMENT);
|
hr = AddRequest(Request::Type::LINE_SEGMENT);
|
||||||
|
AddToPending(hr);
|
||||||
SK.GetRequest(hr)->construction = (pending.command == Command::CONSTR_SEGMENT);
|
SK.GetRequest(hr)->construction = (pending.command == Command::CONSTR_SEGMENT);
|
||||||
SK.GetEntity(hr.entity(1))->PointForceTo(v);
|
SK.GetEntity(hr.entity(1))->PointForceTo(v);
|
||||||
ConstrainPointByHovered(hr.entity(1));
|
ConstrainPointByHovered(hr.entity(1));
|
||||||
|
@ -961,6 +974,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
|
||||||
SS.UndoRemember();
|
SS.UndoRemember();
|
||||||
for(i = 0; i < 4; i++) {
|
for(i = 0; i < 4; i++) {
|
||||||
lns[i] = AddRequest(Request::Type::LINE_SEGMENT, /*rememberForUndo=*/false);
|
lns[i] = AddRequest(Request::Type::LINE_SEGMENT, /*rememberForUndo=*/false);
|
||||||
|
AddToPending(lns[i]);
|
||||||
}
|
}
|
||||||
for(i = 0; i < 4; i++) {
|
for(i = 0; i < 4; i++) {
|
||||||
Constraint::ConstrainCoincident(
|
Constraint::ConstrainCoincident(
|
||||||
|
@ -1009,6 +1023,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hr = AddRequest(Request::Type::ARC_OF_CIRCLE);
|
hr = AddRequest(Request::Type::ARC_OF_CIRCLE);
|
||||||
|
AddToPending(hr);
|
||||||
// This fudge factor stops us from immediately failing to solve
|
// This fudge factor stops us from immediately failing to solve
|
||||||
// because of the arc's implicit (equal radius) tangent.
|
// because of the arc's implicit (equal radius) tangent.
|
||||||
Vector adj = SS.GW.projRight.WithMagnitude(2/SS.GW.scale);
|
Vector adj = SS.GW.projRight.WithMagnitude(2/SS.GW.scale);
|
||||||
|
@ -1026,6 +1041,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
|
||||||
}
|
}
|
||||||
case Command::CUBIC:
|
case Command::CUBIC:
|
||||||
hr = AddRequest(Request::Type::CUBIC);
|
hr = AddRequest(Request::Type::CUBIC);
|
||||||
|
AddToPending(hr);
|
||||||
SK.GetEntity(hr.entity(1))->PointForceTo(v);
|
SK.GetEntity(hr.entity(1))->PointForceTo(v);
|
||||||
SK.GetEntity(hr.entity(2))->PointForceTo(v);
|
SK.GetEntity(hr.entity(2))->PointForceTo(v);
|
||||||
SK.GetEntity(hr.entity(3))->PointForceTo(v);
|
SK.GetEntity(hr.entity(3))->PointForceTo(v);
|
||||||
|
|
4
src/ui.h
4
src/ui.h
|
@ -706,6 +706,7 @@ public:
|
||||||
hRequest request;
|
hRequest request;
|
||||||
hEntity point;
|
hEntity point;
|
||||||
List<hEntity> points;
|
List<hEntity> points;
|
||||||
|
List<hRequest> requests;
|
||||||
hEntity circle;
|
hEntity circle;
|
||||||
hEntity normal;
|
hEntity normal;
|
||||||
hConstraint constraint;
|
hConstraint constraint;
|
||||||
|
@ -716,6 +717,9 @@ public:
|
||||||
Constraint::Type suggestion;
|
Constraint::Type suggestion;
|
||||||
} pending;
|
} pending;
|
||||||
void ClearPending();
|
void ClearPending();
|
||||||
|
bool IsFromPending(hRequest r);
|
||||||
|
void AddToPending(hRequest r);
|
||||||
|
|
||||||
// The constraint that is being edited with the on-screen textbox.
|
// The constraint that is being edited with the on-screen textbox.
|
||||||
hConstraint constraintBeingEdited;
|
hConstraint constraintBeingEdited;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue