mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-26 08:56:36 +00:00
libgui/GuiCanvasWxBackend.py:GuiBufferedDC.__init__(): directly select buffer into DC.
libroar/RoarCanvasWindow.py:applyTool(): normalise mapPoint w/ viewRect if mapPoint != None.
This commit is contained in:
parent
480dc6231e
commit
5a3cdaca89
@ -22,11 +22,8 @@ class GuiBufferedDC(wx.MemoryDC):
|
||||
viewRect = [m * n for m, n in zip(backend.cellSize, viewRect)]
|
||||
viewSize = [min(m, n) for m, n in zip(canvasSize, clientSize)]
|
||||
viewSize = [m * n for m, n in zip(backend.cellSize, viewSize)]
|
||||
bitmap = wx.Bitmap(viewSize); self.SelectObject(bitmap);
|
||||
bufferDc = wx.MemoryDC(); bufferDc.SelectObject(buffer);
|
||||
self.Blit(0, 0, *viewSize, bufferDc, *viewRect)
|
||||
bufferDc.SelectObject(wx.NullBitmap)
|
||||
self.dc, self.viewSize = dc, viewSize
|
||||
self.SelectObject(buffer); self.SetDeviceOrigin(*viewRect);
|
||||
self.dc, self.viewRect, self.viewSize = dc, viewRect, viewSize
|
||||
# }}}
|
||||
|
||||
class GuiCanvasWxBackend():
|
||||
|
@ -47,6 +47,8 @@ class RoarCanvasWindow(GuiWindow):
|
||||
|
||||
# {{{ applyTool(self, eventDc, eventMouse, keyChar, keyModifiers, mapPoint, mouseDragging, mouseLeftDown, mouseRightDown, tool, viewRect)
|
||||
def applyTool(self, eventDc, eventMouse, keyChar, keyModifiers, mapPoint, mouseDragging, mouseLeftDown, mouseRightDown, tool, viewRect):
|
||||
if mapPoint != None:
|
||||
mapPoint = [a + b for a, b in zip(mapPoint, viewRect)]
|
||||
dirty, self.canvas.dirtyCursor, rc = False, False, False
|
||||
self.canvas.journal.begin()
|
||||
if eventMouse:
|
||||
|
Loading…
Reference in New Issue
Block a user