libtools/ToolObject.py:onSelectEvent(): obtain correct canvas map cell given transparent object selection cell.

This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-14 10:49:11 +02:00
parent 52a575cb47
commit 79f5e4e9e3

View File

@ -102,8 +102,8 @@ class ToolObject(Tool):
dirty = False if isCursor else True dirty = False if isCursor else True
cellNew = self.objectMap[numRow][numCol] cellNew = self.objectMap[numRow][numCol]
if (cellNew[1] == -1) and (cellNew[3] == " "): if (cellNew[1] == -1) and (cellNew[3] == " "):
if (rectY < canvas.size[1]) and (rectX < canvas.size[0]): if ((rectY + disp[1]) < canvas.size[1]) and ((rectX + disp[0]) < canvas.size[0]):
cellNew = canvas.map[rectY][rectX] cellNew = canvas.map[rectY + disp[1]][rectX + disp[0]]
dispatchFn(eventDc, isCursor, [rectX + disp[0], rectY + disp[1], *cellNew], viewRect) dispatchFn(eventDc, isCursor, [rectX + disp[0], rectY + disp[1], *cellNew], viewRect)
return dirty return dirty