From c88d2221e234844a7ea6d5be0260e96ad4554ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 9 Sep 2019 19:03:14 +0200 Subject: [PATCH] libgui/GuiCanvasPanel.py:{onPanelScroll,__init__}(): reset cursor on EVT_SCROLLWIN_LINE{DOWN,UP}. --- libgui/GuiCanvasPanel.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libgui/GuiCanvasPanel.py b/libgui/GuiCanvasPanel.py index 4fcf52b..99cd94f 100644 --- a/libgui/GuiCanvasPanel.py +++ b/libgui/GuiCanvasPanel.py @@ -131,6 +131,15 @@ class GuiCanvasPanel(wx.ScrolledWindow): def onPanelSize(self, event): self._updateScrollBars(); event.Skip(); # }}} + # {{{ onPanelScroll(self, event) + def onPanelScroll(self, event): + if self.canvas.dirtyCursor: + viewRect = self.GetViewStart() + eventDc = self.backend.getDeviceContext(self, viewRect) + self.backend.drawCursorMaskWithJournal(self.canvas.journal, eventDc, viewRect) + self.canvas.dirtyCursor = False + event.Skip() + # }}} # # __init__(self, parent, parentFrame, backend, canvas, defaultCanvasPos, defaultCanvasSize, defaultCellSize, interface): initialisation method @@ -149,6 +158,8 @@ class GuiCanvasPanel(wx.ScrolledWindow): for eventType in (wx.EVT_LEFT_DOWN, wx.EVT_MOTION, wx.EVT_RIGHT_DOWN): self.Bind(eventType, self.onPanelInput) self.Bind(wx.EVT_PAINT, self.onPanelPaint) + self.Bind(wx.EVT_SCROLLWIN_LINEDOWN, self.onPanelScroll) + self.Bind(wx.EVT_SCROLLWIN_LINEUP, self.onPanelScroll) self.Bind(wx.EVT_SIZE, self.onPanelSize) # vim:expandtab foldmethod=marker sw=4 ts=4 tw=120