From 79f5e4e9e3aaece0e9fe1491e1d3b952cc3036de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sat, 14 Sep 2019 10:49:11 +0200 Subject: [PATCH] libtools/ToolObject.py:onSelectEvent(): obtain correct canvas map cell given transparent object selection cell. --- libtools/ToolObject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtools/ToolObject.py b/libtools/ToolObject.py index 151917c..9de2d88 100644 --- a/libtools/ToolObject.py +++ b/libtools/ToolObject.py @@ -102,8 +102,8 @@ class ToolObject(Tool): dirty = False if isCursor else True cellNew = self.objectMap[numRow][numCol] if (cellNew[1] == -1) and (cellNew[3] == " "): - if (rectY < canvas.size[1]) and (rectX < canvas.size[0]): - cellNew = canvas.map[rectY][rectX] + if ((rectY + disp[1]) < canvas.size[1]) and ((rectX + disp[0]) < canvas.size[0]): + cellNew = canvas.map[rectY + disp[1]][rectX + disp[0]] dispatchFn(eventDc, isCursor, [rectX + disp[0], rectY + disp[1], *cellNew], viewRect) return dirty