Skip to content

Commit

Permalink
Fix redraw handling (regression bug)
Browse files Browse the repository at this point in the history
In DistributedProofreaders#238, binding of button-1 (left-click) created a regression
that didn't fire redraws on click properly.

Fixes DistributedProofreaders#613
  • Loading branch information
tangledhelix committed Dec 29, 2024
1 parent 240268a commit 878b96e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/guiguts/maintext.py
Original file line number Diff line number Diff line change
Expand Up @@ -3215,24 +3215,28 @@ def _autoscroll_start(
) -> None:
"""When Button-1 is pressed, turn mouse-drag monitoring on"""
self._autoscroll_active = True
self._on_change()

def _autoscroll_stop(
self, event: tk.Event # pylint: disable=unused-argument
) -> None:
"""When Button-1 is released, turn mouse-drag monitoring off"""
self._autoscroll_active = False
self._on_change()

def _autoscroll_start_peer(
self, event: tk.Event # pylint: disable=unused-argument
) -> None:
"""When Button-1 is pressed, turn mouse-drag monitoring on"""
self._autoscroll_peer_active = True
self._on_change()

def _autoscroll_stop_peer(
self, event: tk.Event # pylint: disable=unused-argument
) -> None:
"""When Button-1 is released, turn mouse-drag monitoring off"""
self._autoscroll_peer_active = False
self._on_change()

def _autoscroll_main(self, event: tk.Event) -> None:
"""Auto-scroll the main text view when dragging beyond widget border"""
Expand Down Expand Up @@ -3297,6 +3301,7 @@ def _autoscroll_callback(self, textwidget: tk.Text, event: tk.Event) -> None:
delay = 100

self.after(delay, lambda: callback(event))
self._on_change()


def img_from_page_mark(mark: str) -> str:
Expand Down

0 comments on commit 878b96e

Please sign in to comment.