mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-05 23:36:41 +00:00
25 lines
1.0 KiB
Python
25 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
#
|
|
# ToolSelectMove.py
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
#
|
|
|
|
from ToolSelect import ToolSelect
|
|
|
|
class ToolSelectMove(ToolSelect):
|
|
name = "Move selection"
|
|
|
|
#
|
|
# onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect)
|
|
def onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect):
|
|
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, " "])
|
|
for numRow in range(len(self.toolSelectMap)):
|
|
for numCol in range(len(self.toolSelectMap[numRow])):
|
|
cellOld = self.toolSelectMap[numRow][numCol]
|
|
rectX, rectY = selectRect[0][0] + numCol, selectRect[0][1] + numRow
|
|
dispatchFn(eventDc, isCursor, [rectX + disp[0], rectY + disp[1], *cellOld])
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|