From 2f85fa8cd1f7aa9e24e2c836e0a38ef595b3bde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:56:28 +0100 Subject: [PATCH] MiRCARTToolFill.py: set qualifying colour from current cell. --- MiRCARTToolFill.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MiRCARTToolFill.py b/MiRCARTToolFill.py index 3a7ef22..9235275 100644 --- a/MiRCARTToolFill.py +++ b/MiRCARTToolFill.py @@ -32,13 +32,14 @@ class MiRCARTToolFill(MiRCARTTool): # onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): XXX def onMouseEvent(self, event, atPoint, brushColours, brushSize, isDragging, isLeftDown, isRightDown, dispatchFn, eventDc): pointStack = [list(atPoint)] + testColour = self.parentCanvas.canvasMap[atPoint[1]][atPoint[0]][0][1] if isLeftDown or isRightDown: if isRightDown: brushColours = [brushColours[1], brushColours[0]] while len(pointStack) > 0: point = pointStack.pop() pointCell = self.parentCanvas.canvasMap[point[1]][point[0]] - if pointCell[0][1] == brushColours[1]: + if pointCell[0][1] == testColour: dispatchFn(eventDc, False, [point.copy(), \ [brushColours[0], brushColours[0]], 0, " "]) if point[0] > 0: