Skip to content

Add option to zoom out past best fit - #98

Open
Omegadarling wants to merge 1 commit into
voidtools:masterfrom
Omegadarling:zoom-out-past-best-fit
Open

Omegadarling wants to merge 1 commit into
voidtools:masterfrom
Omegadarling:zoom-out-past-best-fit

Conversation

@Omegadarling

Copy link
Copy Markdown

Zooming out at best fit now keeps shrinking the image in 0.8x steps, so large images can be made smaller than best fit and small images smaller than 1:1. It stops before the image would be under 32 pixels on both sides.

  • Zooming in steps back up through the shrink levels to best fit, then enlarges as before.
  • Best Fit, Zoom Reset and loading another image return to best fit.
  • 1:1 remembers the shrink level and restores it when 1:1 is turned off.
  • When no zoom level is smaller than 1:1 (images that fit the window), zooming out of 1:1 goes to best fit if that is smaller, otherwise to the first shrink level smaller than 1:1. Images too small to shrink stay at 1:1. Larger images still step down to the nearest zoom level below 1:1 as before.
  • Leaving 1:1 by zooming out now always redraws; before, landing on best fit could leave the 1:1 frame on screen.
  • Works with View > Allow Shrinking turned off, since zooming out is an explicit request.

The option is on by default and can be turned off in Options > View > "Allow zooming out past best fit" (ini: zoom_out_past_best_fit). Turning it off returns to best fit.

Notes for merging

  • master does not build until one of the open build-fix pull requests (88 or 95) lands. The new control ID is 1068 so it does not collide with the IDs those add (1055-1066). The companion "Escape closes the viewer" pull request uses 1067.
  • res/voidImageViewer.rc will conflict with 88/95 in IDD_VIEW, because they rename the IDs on the lines this change moves down. The right resolution keeps their IDs (IDC_CACHE_LAST_IMAGE_STATIC, IDC_*BACKGROUNDCOLOR_STATIC and _BUTTON) with this change's positions: the checkbox at 0,119 after "Cache &last image", and the background color labels and buttons at y 139/137 and 157/155. Taking their side whole drops the checkbox, which silently turns the option off every time Options is closed with OK. I'm happy to rebase once a build fix is merged.
  • The Chinese label is a best-effort translation and may need a native speaker's review.

🤖 Generated with Claude Code

Zooming out at best fit now keeps shrinking the image in 0.8x steps, so
large images can be made smaller than best fit and small images smaller
than 1:1. It stops before the image would be under 32 pixels on both
sides.

- Zooming in steps back up through the shrink levels to best fit, then
  enlarges as before.
- Best Fit, Zoom Reset and loading another image return to best fit.
- 1:1 remembers the shrink level and restores it when 1:1 is turned off.
- When no zoom level is smaller than 1:1 (images that fit the window),
  zooming out of 1:1 goes to best fit if that is smaller, otherwise to
  the first shrink level smaller than 1:1. Images too small to shrink
  stay at 1:1. Larger images still step down to the nearest zoom level
  below 1:1 as before.
- Leaving 1:1 by zooming out now always redraws; before, landing on
  best fit could leave the 1:1 frame on screen.
- Works with View > Allow Shrinking turned off, since zooming out is an
  explicit request.

The option is on by default and can be turned off in Options > View >
"Allow zooming out past best fit" (ini: zoom_out_past_best_fit).
Turning it off returns to best fit.

Notes for merging:
- master does not build until one of the open build-fix pull requests
  (88 or 95) lands. The new control ID is 1068 so it does not collide
  with the IDs those add (1055-1066). The companion "Escape closes the
  viewer" pull request uses 1067.
- res/voidImageViewer.rc will conflict with 88/95 in IDD_VIEW, because
  they rename the IDs on the lines this change moves down. The right
  resolution keeps their IDs (IDC_CACHE_LAST_IMAGE_STATIC,
  IDC_*BACKGROUNDCOLOR_STATIC and _BUTTON) with this change's positions:
  the checkbox at 0,119 after "Cache &last image", and the background
  color labels and buttons at y 139/137 and 157/155. Taking their side
  whole drops the checkbox, which silently turns the option off every
  time Options is closed with OK. I'm happy to rebase once a build fix
  is merged.
- The Chinese label is a best-effort translation and may need a native
  speaker's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant