mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-26 08:56:36 +00:00
libtools/ToolSelectMove.py: exclude sub-cells of both of {select,src}Rect from being cleared.
libtools/ToolSelect.py: minor cleanup.
This commit is contained in:
parent
16689cf97f
commit
9ce04b2b9d
@ -60,7 +60,7 @@ class ToolSelect(Tool):
|
|||||||
self.targetRect[0][0], self.targetRect[1][0] = self.targetRect[1][0], self.targetRect[0][0]
|
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]:
|
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.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):
|
for numRow in range((self.targetRect[1][1] - self.targetRect[0][1]) + 1):
|
||||||
self.toolSelectMap.append([])
|
self.toolSelectMap.append([])
|
||||||
for numCol in range((self.targetRect[1][0] - self.targetRect[0][0]) + 1):
|
for numCol in range((self.targetRect[1][0] - self.targetRect[0][0]) + 1):
|
||||||
|
@ -13,9 +13,12 @@ class ToolSelectMove(ToolSelect):
|
|||||||
# onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect)
|
# onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect)
|
||||||
def onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect):
|
def onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect):
|
||||||
dirty = False
|
dirty = False
|
||||||
for numRow in range(len(self.toolSelectMap)):
|
for numRow in range(self.srcRect[0][1], self.srcRect[1][1]):
|
||||||
for numCol in range(len(self.toolSelectMap[numRow])):
|
for numCol in range(self.srcRect[0][0], self.srcRect[1][0]):
|
||||||
dispatchFn(eventDc, isCursor, [self.srcRect[0] + numCol, self.srcRect[1] + numRow, 1, 1, 0, " "], viewRect)
|
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 numRow in range(len(self.toolSelectMap)):
|
||||||
for numCol in range(len(self.toolSelectMap[numRow])):
|
for numCol in range(len(self.toolSelectMap[numRow])):
|
||||||
cellOld = self.toolSelectMap[numRow][numCol]
|
cellOld = self.toolSelectMap[numRow][numCol]
|
||||||
|
Loading…
Reference in New Issue
Block a user