Skip to content

Commit

Permalink
+ fixes #1479: 'Escape' key dismissing dialog cancels Sketch editing
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Mar 18, 2014
1 parent 498032f commit ca6d372
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -132,6 +132,7 @@ struct EditData {
EditData():
sketchHandler(0),
editDatumDialog(false),
buttonPress(false),
DragPoint(-1),
DragCurve(-1),
DragConstraint(-1),
Expand All @@ -154,6 +155,7 @@ struct EditData {
// pointer to the active handler for new sketch objects
DrawSketchHandler *sketchHandler;
bool editDatumDialog;
bool buttonPress;

// dragged point
int DragPoint;
Expand Down Expand Up @@ -358,6 +360,14 @@ bool ViewProviderSketch::keyPressed(bool pressed, int key)
}
return true;
}
if (edit) {
// #0001479: 'Escape' key dismissing dialog cancels Sketch editing
// If we receive a button release event but not a press event before
// then ignore this one.
if (!pressed && !edit->buttonPress)
return true;
edit->buttonPress = pressed;
}
return false;
}
default:
Expand Down

0 comments on commit ca6d372

Please sign in to comment.