mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 23:36:36 +00:00
d342a9d804
libgui/GuiCanvasPanel.py:{applyTool,onPanelInput}(): split from onPanelInput(). libtools/Tool{,Circle,Fill,Line,Rect,Select,Text}.py:on{Keyboard,Mouse}Event(): updated. libtools/ToolFill.py:onMouseEvent(): display cursor. libtools/ToolSelect{,Clone,Move}.py:onSelectEvent(): updated.
23 lines
875 B
Python
23 lines
875 B
Python
#!/usr/bin/env python3
|
|
#
|
|
# ToolSelectClone.py
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
#
|
|
|
|
from ToolSelect import ToolSelect
|
|
|
|
class ToolSelectClone(ToolSelect):
|
|
name = "Clone selection"
|
|
|
|
#
|
|
# onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect)
|
|
def onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect, viewRect):
|
|
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], viewRect)
|
|
return True
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|