mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-25 15:53:12 +03:00
Fix error after resizing the document if there was an action preview
If you confirmed the dialog with Enter after hovering over the canvas, previously it got: IndexError: list index out of range when canceling the preview after it became outdated in regard to the canvas size.
This commit is contained in:
parent
cbbaf18945
commit
77fa6cb444
@ -2316,6 +2316,8 @@ class PaintApp(App[None]):
|
||||
if width < 1 or height < 1:
|
||||
raise ValueError
|
||||
|
||||
self.cancel_preview()
|
||||
|
||||
# TODO: DRY undo state creation (at least the undos/redos part)
|
||||
action = Action(_("Attributes"), Region(0, 0, self.image.width, self.image.height))
|
||||
action.is_resize = True
|
||||
|
Loading…
Reference in New Issue
Block a user