Forcibly show the current group once we start a drawing operation.

pull/36/head
EvilSpirit 2016-08-07 19:59:51 +07:00 committed by whitequark
parent b2ab15c2e1
commit 065a0a8b00
1 changed files with 16 additions and 3 deletions

View File

@ -902,8 +902,8 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
v = v.Plus(projRight.ScaledBy(mx/scale)); v = v.Plus(projRight.ScaledBy(mx/scale));
v = v.Plus(projUp.ScaledBy(my/scale)); v = v.Plus(projUp.ScaledBy(my/scale));
hRequest hr = {};
hRequest hr; hConstraint hc = {};
switch(pending.operation) { switch(pending.operation) {
case Pending::COMMAND: case Pending::COMMAND:
switch(pending.command) { switch(pending.command) {
@ -960,6 +960,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
pending.operation = Pending::DRAGGING_NEW_POINT; pending.operation = Pending::DRAGGING_NEW_POINT;
pending.point = lns[1].entity(2); pending.point = lns[1].entity(2);
pending.description = "click to place other corner of rectangle"; pending.description = "click to place other corner of rectangle";
hr = lns[0];
break; break;
} }
case Command::CIRCLE: case Command::CIRCLE:
@ -1062,7 +1063,7 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
c.type = Constraint::Type::COMMENT; c.type = Constraint::Type::COMMENT;
c.disp.offset = v; c.disp.offset = v;
c.comment = "NEW COMMENT -- DOUBLE-CLICK TO EDIT"; c.comment = "NEW COMMENT -- DOUBLE-CLICK TO EDIT";
Constraint::AddConstraint(&c); hc = Constraint::AddConstraint(&c);
break; break;
} }
default: ssassert(false, "Unexpected pending menu id"); default: ssassert(false, "Unexpected pending menu id");
@ -1190,6 +1191,18 @@ void GraphicsWindow::MouseLeftDown(double mx, double my) {
break; break;
} }
// Activate group with newly created request/constraint
Group *g = NULL;
if(hr.v != 0) {
g = SK.GetGroup(SK.GetRequest(hr)->group);
}
if(hc.v != 0) {
g = SK.GetGroup(SK.GetConstraint(hc)->group);
}
if(g != NULL) {
g->visible = true;
}
SS.ScheduleShowTW(); SS.ScheduleShowTW();
InvalidateGraphics(); InvalidateGraphics();
} }