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 7ed4d5f49d
commit 81e8098f1e

View File

@ -102,7 +102,8 @@ class ToolObject(Tool):
def onKeyboardEvent(self, atPoint, brushColours, brushPos, brushSize, canvas, dispatchFn, eventDc, keyChar, keyCode, keyModifiers, mapPoint): def onKeyboardEvent(self, atPoint, brushColours, brushPos, brushSize, canvas, dispatchFn, eventDc, keyChar, keyCode, keyModifiers, mapPoint):
rc, dirty = False, False 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) dirty = self.onSelectEvent(canvas, (0, 0), dispatchFn, eventDc, False, keyModifiers, self.targetRect.copy(), self.targetRect)
self._drawSelectRect(self.targetRect, dispatchFn, eventDc) self._drawSelectRect(self.targetRect, dispatchFn, eventDc)
self.objectMap, self.objectSize, self.targetRect, self.toolState = None, None, None, self.TS_NONE self.objectMap, self.objectSize, self.targetRect, self.toolState = None, None, None, self.TS_NONE