Repository navigation
Conversation
Selecting a box near an edge gave a shift that moved the slide away from the screen edge (shift_x = +0.44 for a box along the left border), leaving a black void of that width, and zooming again compounded the offset until the slide left the screen. Clamp the zoom to the slide: points are clamped to the widget, the shift to [1 - scale, 0] so the slide always covers the view, a box smaller than 1 % of the slide is ignored (accidental click, division by almost zero) and the scale is capped at 25x.
Owner
|
I get clamping to keep slide in frame and protecting against accidental clicks — but what does capping the scale add? |
Author
|
The 1% span check already prevents division by near-zero and bounds the scale to 100x. The 25x cap was added as a usability guardrail so an accidental small drag (~1–2% of the slide) doesn't produce an extreme 50–90x zoom where a single letter serif fills the entire screen. That said, if you prefer not having an arbitrary cap and letting the 1% threshold be the sole bound, I'm happy to drop the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Selecting a box near an edge of the slide moves the slide away from that edge and leaves a black strip. Zooming again inside the strip compounds the offset until the slide leaves the screen.
Changes
extras.pyonly:[1 - scale, 0], so the slide always covers the view.Tested on Ubuntu 26.04 (WSL), Python 3.14.4, GTK 3.24.52, with a script that drives
Zoom.toggle_zoom_target()with synthetic events on a 1920x1080 widget. Selections along the left and right edges leave a black strip onorigin/mainand none with this branch.Not tested: a real mouse in a running window, Windows and macOS.