Only allow setting selection w/ <Esc> post-selection.

This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-24 18:12:50 +02:00
parent e2183acf46
commit c45a616442

View File

@ -102,7 +102,8 @@ class ToolObject(Tool):
def onKeyboardEvent(self, atPoint, brushColours, brushPos, brushSize, canvas, dispatchFn, eventDc, keyChar, keyCode, keyModifiers, mapPoint):
rc, dirty = False, False
if ord(keyChar) == wx.WXK_ESCAPE:
if (ord(keyChar) == wx.WXK_ESCAPE) \
and (self.toolState >= self.TS_SELECT):
dirty = self.onSelectEvent(canvas, (0, 0), dispatchFn, eventDc, False, keyModifiers, self.targetRect.copy(), self.targetRect)
self._drawSelectRect(self.targetRect, dispatchFn, eventDc)
self.objectMap, self.objectSize, self.targetRect, self.toolState = None, None, None, self.TS_NONE