diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index fa31df2f2..c2cf2fc19 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -132,6 +132,7 @@ struct EditData { EditData(): sketchHandler(0), editDatumDialog(false), + buttonPress(false), DragPoint(-1), DragCurve(-1), DragConstraint(-1), @@ -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; @@ -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: