mirror of
https://github.com/1j01/textual-paint.git
synced 2024-10-27 01:41:29 +03:00
Refresh canvas when resizing document
This commit is contained in:
parent
4effc9d599
commit
6ad4b7e442
@ -40,6 +40,7 @@
|
||||
"stransi",
|
||||
"STRINGTABLE",
|
||||
"ufeff",
|
||||
"undoable",
|
||||
"undos",
|
||||
"ustom",
|
||||
"vkey"
|
||||
|
2
paint.py
2
paint.py
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user