From 81e8098f1e2d68d206d4c075d8c1cf94ec546961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 24 Sep 2019 18:12:50 +0200 Subject: [PATCH] Only allow setting selection w/ post-selection. --- libtools/ToolObject.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtools/ToolObject.py b/libtools/ToolObject.py index 5aa9b01..3e357cd 100644 --- a/libtools/ToolObject.py +++ b/libtools/ToolObject.py @@ -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