2019-09-12 10:49:53 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
|
|
|
# ToolObject.py
|
|
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
|
|
#
|
|
|
|
|
|
|
|
from Tool import Tool
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
import wx
|
2019-09-12 10:49:53 +00:00
|
|
|
|
|
|
|
class ToolObject(Tool):
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
name = "Object"
|
2019-09-12 10:49:53 +00:00
|
|
|
TS_NONE = 0
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
TS_ORIGIN = 1
|
|
|
|
TS_SELECT = 2
|
|
|
|
TS_TARGET = 3
|
2019-09-12 10:49:53 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def _dispatchSelectEvent(self, canvas, keyModifiers, mapPoint, mouseLeftDown, selectRect):
|
2019-09-12 10:49:53 +00:00
|
|
|
if mouseLeftDown:
|
|
|
|
disp, isCursor = [mapPoint[m] - self.lastAtPoint[m] for m in [0, 1]], True
|
|
|
|
newTargetRect = [[selectRect[n][m] + disp[m] for m in [0, 1]] for n in [0, 1]]
|
|
|
|
self.lastAtPoint = list(mapPoint)
|
|
|
|
else:
|
|
|
|
disp, isCursor, newTargetRect = [0, 0], True, selectRect.copy()
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self.onSelectEvent(canvas, disp, isCursor, keyModifiers, newTargetRect, selectRect)
|
|
|
|
patchesCursor = [] if patchesCursor == None else patchesCursor
|
|
|
|
patchesCursor += self._drawSelectRect(newTargetRect)
|
2019-09-12 10:49:53 +00:00
|
|
|
self.targetRect = newTargetRect
|
2019-09-26 20:38:28 +00:00
|
|
|
return rc, patches, patchesCursor
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def _drawSelectRect(self, rect):
|
|
|
|
patches = []
|
2019-09-15 09:55:59 +00:00
|
|
|
rectFrame = [[rect[m][n] for n in [0, 1]] for m in (0, 1)]
|
2019-09-12 10:49:53 +00:00
|
|
|
if rectFrame[0][0] > rectFrame[1][0]:
|
|
|
|
rectFrame[0][0], rectFrame[1][0] = rectFrame[1][0], rectFrame[0][0]
|
|
|
|
if rectFrame[0][1] > rectFrame[1][1]:
|
|
|
|
rectFrame[0][1], rectFrame[1][1] = rectFrame[1][1], rectFrame[0][1]
|
2019-09-15 09:55:59 +00:00
|
|
|
curColours, rectFrame = [0, 0], [[rectFrame[m[0]][n] + m[1] for n in [0, 1]] for m in [[0, -1], [1, +1]]]
|
2019-09-12 10:49:53 +00:00
|
|
|
for rectX in range(rectFrame[0][0], rectFrame[1][0] + 1):
|
|
|
|
curColours = [1, 1] if curColours == [0, 0] else [0, 0]
|
2019-09-26 20:38:28 +00:00
|
|
|
patches += [[rectX, rectFrame[0][1], *curColours, 0, " "], [rectX, rectFrame[1][1], *curColours, 0, " "]]
|
2019-09-12 10:49:53 +00:00
|
|
|
for rectY in range(rectFrame[0][1], rectFrame[1][1] + 1):
|
|
|
|
curColours = [1, 1] if curColours == [0, 0] else [0, 0]
|
2019-09-26 20:38:28 +00:00
|
|
|
patches += [[rectFrame[0][0], rectY, *curColours, 0, " "], [rectFrame[1][0], rectY, *curColours, 0, " "]]
|
|
|
|
return patches
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def _mouseEventTsNone(self, brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown):
|
|
|
|
patchesCursor = [[*mapPoint, brushColours[0], brushColours[0], 0, " "]]; self.substract = False;
|
|
|
|
if (not self.external) and mouseLeftDown:
|
|
|
|
self.targetRect, self.toolState = [list(mapPoint), []], self.TS_ORIGIN
|
|
|
|
return True, None, patchesCursor
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def _mouseEventTsOrigin(self, brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown):
|
2019-09-15 09:55:59 +00:00
|
|
|
self.targetRect[1] = list(mapPoint)
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
if not mouseLeftDown:
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
if self.targetRect[0][0] > self.targetRect[1][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]:
|
|
|
|
self.targetRect[0][1], self.targetRect[1][1] = self.targetRect[1][1], self.targetRect[0][1]
|
|
|
|
self.lastAtPoint, self.srcRect, self.objectMap, self.toolState = list(mapPoint), self.targetRect, [], self.TS_SELECT
|
|
|
|
for numRow in range((self.targetRect[1][1] - self.targetRect[0][1]) + 1):
|
|
|
|
self.objectMap.append([])
|
|
|
|
for numCol in range((self.targetRect[1][0] - self.targetRect[0][0]) + 1):
|
|
|
|
rectX, rectY = self.targetRect[0][0] + numCol, self.targetRect[0][1] + numRow
|
|
|
|
self.objectMap[numRow].append(canvas.map[rectY][rectX])
|
2019-09-26 20:38:28 +00:00
|
|
|
return True, None, self._drawSelectRect(self.targetRect)
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def _mouseEventTsSelect(self, brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown):
|
|
|
|
rc, patches, patchesCursor = False, None, None
|
2019-09-15 09:55:59 +00:00
|
|
|
if mouseLeftDown:
|
|
|
|
if (mapPoint[0] >= (self.targetRect[0][0] - 1)) \
|
|
|
|
and (mapPoint[0] <= (self.targetRect[1][0] + 1)) \
|
|
|
|
and (mapPoint[1] >= (self.targetRect[0][1] - 1)) \
|
|
|
|
and (mapPoint[1] <= (self.targetRect[1][1] + 1)):
|
|
|
|
self.lastAtPoint, self.toolState = list(mapPoint), self.TS_TARGET
|
|
|
|
else:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self.onSelectEvent(canvas, (0, 0), False, keyModifiers, self.targetRect.copy(), self.targetRect)
|
|
|
|
patchesCursor = [] if patchesCursor == None else patchesCursor
|
|
|
|
patchesCursor += self._drawSelectRect(self.targetRect)
|
2019-09-15 17:37:10 +00:00
|
|
|
self.objectMap, self.objectSize, self.targetRect, self.toolState = None, None, None, self.TS_NONE
|
2019-09-12 10:49:53 +00:00
|
|
|
else:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self._dispatchSelectEvent(canvas, keyModifiers, mapPoint, mouseLeftDown, self.targetRect)
|
|
|
|
return rc, patches, patchesCursor
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def _mouseEventTsTarget(self, brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown):
|
|
|
|
rc, patches, patchesCursor = False, None, None
|
2019-09-15 09:55:59 +00:00
|
|
|
if (keyModifiers == wx.MOD_CONTROL) and (self.srcRect == self.targetRect):
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
self.substract = True
|
2019-09-12 10:49:53 +00:00
|
|
|
if mouseLeftDown:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self._dispatchSelectEvent(canvas, keyModifiers, mapPoint, mouseLeftDown, self.targetRect)
|
2019-09-12 10:49:53 +00:00
|
|
|
else:
|
|
|
|
self.toolState = self.TS_SELECT
|
2019-09-26 20:38:28 +00:00
|
|
|
return rc, patches, patchesCursor
|
2019-09-12 10:49:53 +00:00
|
|
|
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
def getRegion(self, canvas):
|
|
|
|
return self.objectMap
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def onKeyboardEvent(self, atPoint, brushColours, brushPos, brushSize, canvas, keyChar, keyCode, keyModifiers, mapPoint):
|
|
|
|
if (ord(keyChar) == wx.WXK_ESCAPE) and (self.toolState >= self.TS_SELECT):
|
|
|
|
rc, patches, patchesCursor = self.onSelectEvent(canvas, (0, 0), False, keyModifiers, self.targetRect.copy(), self.targetRect)
|
|
|
|
patchesCursor = [] if patchesCursor == None else patchesCursor
|
|
|
|
patchesCursor += self._drawSelectRect(self.targetRect)
|
2019-09-23 17:19:43 +00:00
|
|
|
self.objectMap, self.objectSize, self.targetRect, self.toolState = None, None, None, self.TS_NONE
|
2019-09-26 20:38:28 +00:00
|
|
|
else:
|
|
|
|
rc, patches, patchesCursor = False, None, None
|
|
|
|
return rc, patches, patchesCursor
|
2019-09-23 17:19:43 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def onMouseEvent(self, atPoint, brushColours, brushPos, brushSize, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown, mouseRightDown):
|
2019-09-12 10:49:53 +00:00
|
|
|
if self.toolState == self.TS_NONE:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self._mouseEventTsNone(brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown)
|
2019-09-12 10:49:53 +00:00
|
|
|
elif self.toolState == self.TS_SELECT:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self._mouseEventTsSelect(brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown)
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
elif self.toolState == self.TS_ORIGIN:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self._mouseEventTsOrigin(brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown)
|
2019-09-12 10:49:53 +00:00
|
|
|
elif self.toolState == self.TS_TARGET:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = self._mouseEventTsTarget(brushColours, canvas, keyModifiers, mapPoint, mouseDragging, mouseLeftDown)
|
2019-09-12 10:49:53 +00:00
|
|
|
else:
|
2019-09-26 20:38:28 +00:00
|
|
|
rc, patches, patchesCursor = False, None, None
|
|
|
|
return rc, patches, patchesCursor
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
2019-09-26 20:38:28 +00:00
|
|
|
def onSelectEvent(self, canvas, disp, isCursor, keyModifiers, newTargetRect, selectRect):
|
|
|
|
patches = []
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
if self.external:
|
|
|
|
for numRow in range(len(self.objectMap)):
|
|
|
|
for numCol in range(len(self.objectMap[numRow])):
|
|
|
|
rectX, rectY = selectRect[0][0] + numCol, selectRect[0][1] + numRow
|
|
|
|
cellNew = self.objectMap[numRow][numCol]
|
|
|
|
if (cellNew[1] == -1) and (cellNew[3] == " "):
|
|
|
|
if ((rectY + disp[1]) < canvas.size[1]) and ((rectX + disp[0]) < canvas.size[0]):
|
|
|
|
cellNew = canvas.map[rectY + disp[1]][rectX + disp[0]]
|
2019-09-26 20:38:28 +00:00
|
|
|
patches += [[rectX + disp[0], rectY + disp[1], *cellNew]]
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
else:
|
|
|
|
if self.substract:
|
|
|
|
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])):
|
2019-09-26 20:38:28 +00:00
|
|
|
patches += [[numCol, numRow, 1, 1, 0, " "]]
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
for numRow in range(len(self.objectMap)):
|
|
|
|
for numCol in range(len(self.objectMap[numRow])):
|
|
|
|
cellOld = self.objectMap[numRow][numCol]
|
|
|
|
rectX, rectY = selectRect[0][0] + numCol, selectRect[0][1] + numRow
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
cellNew = self.objectMap[numRow][numCol]
|
|
|
|
if (cellNew[1] == -1) and (cellNew[3] == " "):
|
|
|
|
if ((rectY + disp[1]) < canvas.size[1]) and ((rectX + disp[0]) < canvas.size[0]):
|
|
|
|
cellNew = canvas.map[rectY + disp[1]][rectX + disp[0]]
|
2019-09-26 20:38:28 +00:00
|
|
|
patches += [[rectX + disp[0], rectY + disp[1], *cellNew]]
|
|
|
|
return True, patches if not isCursor else None, patches if isCursor else None
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
def setRegion(self, canvas, mapPoint, objectMap, objectSize, external=True):
|
|
|
|
self.external, self.toolState = external, self.TS_SELECT
|
|
|
|
if mapPoint != None:
|
|
|
|
self.lastAtPoint = list(mapPoint)
|
|
|
|
if self.targetRect == None:
|
|
|
|
self.targetRect = [list(self.lastAtPoint), [(a + b) - (0 if a == b else 1) for a, b in zip(self.lastAtPoint, objectSize)]]
|
|
|
|
elif self.objectSize != objectSize:
|
|
|
|
if self.objectSize == None:
|
|
|
|
self.objectSize = objectSize
|
2019-09-21 09:27:52 +00:00
|
|
|
self.targetRect[1] = [t + d for t, d in zip(self.targetRect[1], (b - a for a, b in zip(self.objectSize, objectSize)))]
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
if self.srcRect == None:
|
|
|
|
self.srcRect = self.targetRect
|
2019-09-12 10:49:53 +00:00
|
|
|
self.objectMap, self.objectSize = objectMap, objectSize
|
Various bugfixes & usability improvements.
1) Add background colour toolbar beneath (foreground) colour toolbar.
2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}.
3) Add {de,in}crease {brush,canvas} size accelerator.
4) Add {hide,show} assets window toolbar item.
5) Circle tool: draw outline with foreground colour.
6) Circle tool: honour transparency.
7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>.
8) Fill tool: fill with {back,fore}ground colour given <[RL]MB>
9) Fix arrow keys cursor motion when scrolled down.
10 Instantly reflect {brush size,colour,tool} changes in canvas.
11) Object tool: honour transparency w/ non-external objects.
12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>.
13) Rectangle tool: draw outline with foreground colour.
14) Rectangle tool: honour transparency.
15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt().
16) Restore scrolling position after resizing canvas.
.TODO: deleted.
assets/audio/roar{arab8,spoke11}.wav: added.
assets/text/hotkeys.txt: added to document hotkeys.
assets/text/requirements.txt, requirements.txt: moved.
assets/text/TODO: updated.
{assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers.
libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message.
libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
2019-09-23 16:49:33 +00:00
|
|
|
|
Implements merged object tool & flip operators.
assets/images/toolObject.png: added.
liboperators/Operator{,Flip{Horizontal,Vertical}}.py: initial implementation.
libroar/RoarCanvasCommands.py: adds RoarCanvasCommandsOperators.
libroar/RoarCanvasCommandsOperators.py: initial implementation.
libroar/Roar{CanvasCommands{,Tools},Client}.py: replaces ToolSelect{Clone,Move} w/ ToolObject.
libroar/RoarCanvasWindow.py:RoarCanvasWindowDropTarget.OnDropText(): update ToolObject() invocation.
libroar/RoarCanvasWindow.py:{applyTool,onMouseInput}(): pass keyModifiers to Tool.onMouseEvent().
libroar/RoarCanvasWindow.py:applyTool(): only switch back to lastTool if current object tool contains an external object.
libroar/RoarCanvasWindow.py:onLeaveWindow(): disable hiding cursor for now.
libtools/Tool{,Circle,Fill,Line,Rect,Text}.py:onMouseEvent(): update type signature.
libtools/Tool{Object,Select{,Clone,Move}}.py: merged into libtools/ToolObject.py.
roar.py: add liboperators to sys.path[].
assets/text/TODO: updated.
2019-09-15 09:06:25 +00:00
|
|
|
def __init__(self, *args):
|
|
|
|
super().__init__(*args)
|
|
|
|
self.external, self.lastAtPoint, self.srcRect, self.substract, \
|
|
|
|
self.targetRect, self.objectMap, self.objectSize, self.toolState = \
|
|
|
|
False, None, None, False, None, [], None, self.TS_NONE
|
2019-09-12 10:49:53 +00:00
|
|
|
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|