From 34dddd3e2ba1fc241e4c039dd34233601a8dbc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 8 Sep 2019 17:02:41 +0200 Subject: [PATCH] libtools/ToolText.py:onMouseEvent(): only set self.textPos on is{Left,Right}Down. --- libtools/ToolText.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libtools/ToolText.py b/libtools/ToolText.py index bb2e227..0e60879 100644 --- a/libtools/ToolText.py +++ b/libtools/ToolText.py @@ -33,8 +33,9 @@ class ToolText(Tool): # # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): - self.textPos = list(atPoint) - dispatchFn(eventDc, True, [*self.textPos, *brushColours, 0, "_"]) + if isLeftDown or isRightDown: + self.textPos = list(atPoint) + dispatchFn(eventDc, True, [*atPoint, *brushColours, 0, "_"]) # __init__(self, *args): initialisation method def __init__(self, *args):