Select pencil when trying to draw with unimplemented tool

This commit is contained in:
Isaiah Odhner 2023-04-11 12:30:36 -04:00
parent 470e6e119e
commit 4c2fc00e45

View File

@ -334,6 +334,9 @@ class PaintApp(App):
def on_canvas_tool_start(self, event: Canvas.ToolStart) -> None: def on_canvas_tool_start(self, event: Canvas.ToolStart) -> None:
"""Called when the user starts drawing on the canvas.""" """Called when the user starts drawing on the canvas."""
if self.selected_tool != Tool.pencil and self.selected_tool != Tool.brush:
self.selected_tool = Tool.pencil
# TODO: support other tools
self.stamp_brush(event.mouse_down_event.x, event.mouse_down_event.y) self.stamp_brush(event.mouse_down_event.x, event.mouse_down_event.y)
self.canvas.refresh() self.canvas.refresh()
event.stop() event.stop()