From dc02833f3f1b6433cf1ef38adf22610d1baf7a10 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Mon, 24 Apr 2023 01:27:11 -0400 Subject: [PATCH] Shorten selected tool condition (DRY) --- paint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paint.py b/paint.py index ba59539..1eb576a 100755 --- a/paint.py +++ b/paint.py @@ -2212,7 +2212,7 @@ class PaintApp(App[None]): action = Action(self.selected_tool.get_name(), self.image, affected_region) self.undos.append(action) - if self.selected_tool == Tool.pencil or self.selected_tool == Tool.brush or self.selected_tool == Tool.eraser or self.selected_tool == Tool.airbrush: + if self.selected_tool in [Tool.pencil, Tool.brush, Tool.eraser, Tool.airbrush]: for x, y in bresenham_walk(mm.x - mm.delta_x, mm.y - mm.delta_y, mm.x, mm.y): affected_region = self.stamp_brush(x, y, affected_region) elif self.selected_tool == Tool.line: