mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 06:11:37 +03:00
Shorten selected tool condition (DRY)
This commit is contained in:
parent
a875c61fff
commit
dc02833f3f
2
paint.py
2
paint.py
@ -2212,7 +2212,7 @@ class PaintApp(App[None]):
|
|||||||
action = Action(self.selected_tool.get_name(), self.image, affected_region)
|
action = Action(self.selected_tool.get_name(), self.image, affected_region)
|
||||||
self.undos.append(action)
|
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):
|
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)
|
affected_region = self.stamp_brush(x, y, affected_region)
|
||||||
elif self.selected_tool == Tool.line:
|
elif self.selected_tool == Tool.line:
|
||||||
|
Loading…
Reference in New Issue
Block a user