Return to custom zoom level when zooming out and back in

This commit is contained in:
Isaiah Odhner 2023-07-11 02:41:44 -04:00
parent 9876a3c15c
commit 67b4ec8ac4
2 changed files with 3 additions and 1 deletions

View File

@ -201,7 +201,6 @@ To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja,
- Can click Cancel button of Edit Colors dialog while opening it, if the mouse lines up with it.
- Hitting Enter in View Bitmap mode exits the mode but may also trigger a menu item. Menu items ought to be disabled when hidden, and View Bitmap should prevent the key event from taking other actions if possible.
- Airbrush is continuous in space instead of time. It should keep spraying while the mouse stays still.
- After setting a custom zoom level, the magnifier tool will not return to the custom zoom level when un-magnifying and re-magnifying.
The program has only been tested on Linux. Issues on other platforms are as-yet _unknown_ :)

View File

@ -2441,6 +2441,9 @@ class PaintApp(App[None]):
def watch_magnification(self, old_magnification: int, magnification: int) -> None:
"""Called when magnification changes."""
self.canvas.magnification = magnification
if old_magnification != 1:
self.return_to_magnification = old_magnification
# TODO: keep the top left corner of the viewport in the same place
# https://github.com/1j01/jspaint/blob/12a90c6bb9d36f495dc6a07114f9667c82ee5228/src/functions.js#L326-L351
# This will matter more when large documents don't freeze up the program...