From ab76aacff353aeb80b004609ac97bae68a447962 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Tue, 11 Apr 2023 10:48:42 -0400 Subject: [PATCH] Stop bubbling of canvas tool events --- paint.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paint.py b/paint.py index 220d8b5..1c4ff41 100644 --- a/paint.py +++ b/paint.py @@ -313,12 +313,14 @@ class PaintApp(App): """Called when the user starts drawing on the canvas.""" self.draw_dot(event.mouse_down_event.x, event.mouse_down_event.y) self.canvas.refresh() + event.stop() def on_canvas_tool_update(self, event: Canvas.ToolUpdate) -> None: """Called when the user is drawing on the canvas.""" mm = event.mouse_move_event bresenham_walk(mm.x - mm.delta_x, mm.y - mm.delta_y, mm.x, mm.y, lambda x, y: self.draw_dot(x, y)) self.canvas.refresh() + event.stop() def on_key(self, event: events.Key) -> None: """Called when the user presses a key."""