Refresh canvas when resizing document

This commit is contained in:
Isaiah Odhner 2023-04-28 15:27:23 -04:00
parent 4effc9d599
commit 6ad4b7e442
2 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,7 @@
"stransi",
"STRINGTABLE",
"ufeff",
"undoable",
"undos",
"ustom",
"vkey"

View File

@ -2075,7 +2075,9 @@ class PaintApp(App[None]):
height = int(window.content.query_one("#height_input", Input).value)
if width < 1 or height < 1:
raise ValueError
# TODO: make this undoable
self.image.resize(width, height, default_bg=self.selected_bg_color, default_fg=self.selected_fg_color)
self.canvas.refresh(layout=True)
window.close()
except ValueError:
self.warning_message_box(_("Attributes"), _("Please enter a positive integer."), "ok")