2019-09-01 10:34:00 -04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
2019-09-08 12:08:04 -04:00
|
|
|
# ToolSelectClone.py
|
2019-09-04 10:23:59 -04:00
|
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
2019-09-01 10:34:00 -04:00
|
|
|
#
|
|
|
|
|
2019-09-03 12:58:50 -04:00
|
|
|
from ToolSelect import ToolSelect
|
2019-09-01 10:34:00 -04:00
|
|
|
|
2019-09-03 12:58:50 -04:00
|
|
|
class ToolSelectClone(ToolSelect):
|
2019-09-01 10:34:00 -04:00
|
|
|
name = "Clone selection"
|
|
|
|
|
|
|
|
#
|
2019-09-08 12:08:04 -04:00
|
|
|
# onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect)
|
2019-09-03 09:48:48 -04:00
|
|
|
def onSelectEvent(self, disp, dispatchFn, eventDc, isCursor, newToolRect, selectRect):
|
2019-09-01 10:34:00 -04:00
|
|
|
for numRow in range(len(self.toolSelectMap)):
|
|
|
|
for numCol in range(len(self.toolSelectMap[numRow])):
|
|
|
|
cellOld = self.toolSelectMap[numRow][numCol]
|
2019-09-03 09:48:48 -04:00
|
|
|
rectX, rectY = selectRect[0][0] + numCol, selectRect[0][1] + numRow
|
Initial canvas panel scrollbar implementation.
assets/text/TODO: updated.
libgui/GuiCanvasPanel.py:__init__(): provide self.winSize & call SetScrollRate().
libgui/GuiCanvasPanel.py:{_drawPatch,dispatch{DeltaPatches,Patch},onPanel{Input,LeaveWindow},resize,update}(): receive and/or pass viewRect.
libgui/GuiCanvasPanel.py:onPanelPaint(): updated.
libgui/GuiCanvasPanel.py:resize(): call SetVirtualSize().
libgui/GuiCanvasWxBackend.py:_{draw{Brush,Char}Patch,_get{Brush,Char}PatchColours,xlatePoint}(): updated.
libgui/GuiCanvasWxBackend.py:{draw{CursorMaskWithJournal,Patch},getDeviceContext,xlateEventPoint}(): receive and/or pass viewRect.
libgui/GuiCanvasWxBackend.py:getDeviceContext(): return ClientDC() if viewRect > (0, 0)
libgui/GuiCanvasWxBackend.py:onPanelPaintEvent(): blit subset of canvasBitmap into BufferedPaintDC() if viewRect > (0, 0).
libtools/Tool{,Circle,Fill,Line,Rect,Select{,Clone,Move},Text}.py: receive & pass viewRect to dispatchFn().
2019-09-09 06:30:25 -04:00
|
|
|
dispatchFn(eventDc, isCursor, [rectX + disp[0], rectY + disp[1], *cellOld], viewRect)
|
2019-09-01 10:34:00 -04:00
|
|
|
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|