mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 07:16:38 +00:00
libtools/ToolText.py:onKeyboardEvent(): correctly return (rc, dirty).
This commit is contained in:
parent
fb274c0d66
commit
309e8cf089
@ -13,22 +13,20 @@ class ToolText(Tool):
|
|||||||
#
|
#
|
||||||
# onKeyboardEvent(self, brushColours, brushSize, dispatchFn, eventDc, keyChar, keyModifiers, mapPoint, viewRect)
|
# onKeyboardEvent(self, brushColours, brushSize, dispatchFn, eventDc, keyChar, keyModifiers, mapPoint, viewRect)
|
||||||
def onKeyboardEvent(self, brushColours, brushSize, canvas, dispatchFn, eventDc, keyChar, keyModifiers, mapPoint, viewRect):
|
def onKeyboardEvent(self, brushColours, brushSize, canvas, dispatchFn, eventDc, keyChar, keyModifiers, mapPoint, viewRect):
|
||||||
dirty = False
|
if keyModifiers in (wx.MOD_NONE, wx.MOD_SHIFT):
|
||||||
if not keyModifiers in (wx.MOD_NONE, wx.MOD_SHIFT):
|
rc, dirty = True, True
|
||||||
return False
|
|
||||||
else:
|
|
||||||
if self.textPos == None:
|
if self.textPos == None:
|
||||||
self.textPos = list(mapPoint)
|
self.textPos = list(mapPoint)
|
||||||
if not dirty:
|
dispatchFn(eventDc, False, [*self.textPos, *brushColours, 0, keyChar], viewRect)
|
||||||
dirty = True
|
if self.textPos[0] < (canvas.size[0] - 1):
|
||||||
dispatchFn(eventDc, False, [*self.textPos, *brushColours, 0, keyChar], viewRect)
|
self.textPos[0] += 1
|
||||||
if self.textPos[0] < (canvas.size[0] - 1):
|
elif self.textPos[1] < (canvas.size[1] - 1):
|
||||||
self.textPos[0] += 1
|
self.textPos[0] = 0; self.textPos[1] += 1;
|
||||||
elif self.textPos[1] < (canvas.size[1] - 1):
|
else:
|
||||||
self.textPos[0] = 0; self.textPos[1] += 1;
|
self.textPos = [0, 0]
|
||||||
else:
|
else:
|
||||||
self.textPos = [0, 0]
|
rc, dirty = False, False
|
||||||
return True, dirty
|
return rc, dirty
|
||||||
|
|
||||||
#
|
#
|
||||||
# onMouseEvent(self, brushColours, brushSize, dispatchFn, eventDc, mapPoint, mouseDragging, mouseLeftDown, mouseRightDown, viewRect)
|
# onMouseEvent(self, brushColours, brushSize, dispatchFn, eventDc, mapPoint, mouseDragging, mouseLeftDown, mouseRightDown, viewRect)
|
||||||
|
Loading…
Reference in New Issue
Block a user