diff --git a/libtools/ToolSelect.py b/libtools/ToolSelect.py index 73dde94..932e6fe 100644 --- a/libtools/ToolSelect.py +++ b/libtools/ToolSelect.py @@ -60,7 +60,7 @@ class ToolSelect(Tool): self.targetRect[0][0], self.targetRect[1][0] = self.targetRect[1][0], self.targetRect[0][0] if self.targetRect[0][1] > self.targetRect[1][1]: self.targetRect[0][1], self.targetRect[1][1] = self.targetRect[1][1], self.targetRect[0][1] - self.srcRect, self.lastAtPoint, self.toolSelectMap, self.toolState = self.targetRect[0], list(mapPoint), [], self.TS_SELECT + self.lastAtPoint, self.srcRect, self.toolSelectMap, self.toolState = list(mapPoint), self.targetRect, [], self.TS_SELECT for numRow in range((self.targetRect[1][1] - self.targetRect[0][1]) + 1): self.toolSelectMap.append([]) for numCol in range((self.targetRect[1][0] - self.targetRect[0][0]) + 1): diff --git a/libtools/ToolSelectMove.py b/libtools/ToolSelectMove.py index 2ba395f..10058b3 100644 --- a/libtools/ToolSelectMove.py +++ b/libtools/ToolSelectMove.py @@ -13,9 +13,12 @@ class ToolSelectMove(ToolSelect): # onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect) def onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect): dirty = False - for numRow in range(len(self.toolSelectMap)): - for numCol in range(len(self.toolSelectMap[numRow])): - dispatchFn(eventDc, isCursor, [self.srcRect[0] + numCol, self.srcRect[1] + numRow, 1, 1, 0, " "], viewRect) + for numRow in range(self.srcRect[0][1], self.srcRect[1][1]): + for numCol in range(self.srcRect[0][0], self.srcRect[1][0]): + if ((numCol < selectRect[0][0]) or (numCol > selectRect[1][0])) \ + or ((numRow < selectRect[0][1]) or (numRow > selectRect[1][1])): + dirty = False if isCursor else True + dispatchFn(eventDc, isCursor, [numCol, numRow, 1, 1, 0, " "], viewRect) for numRow in range(len(self.toolSelectMap)): for numCol in range(len(self.toolSelectMap[numRow])): cellOld = self.toolSelectMap[numRow][numCol]