Skip to content

Magnifying glass improvements (macOS) - #566

Merged
luisangelsm merged 2 commits into
YACReader:developfrom
starlit-void:starlit/magnifier-improvements
Jul 25, 2026
Merged

Magnifying glass improvements (macOS)#566
luisangelsm merged 2 commits into
YACReader:developfrom
starlit-void:starlit/magnifier-improvements

Conversation

@starlit-void

@starlit-void starlit-void commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Two tiny bugfixes in one PR:

  1. Magnifying glass zoom level appears to jump as the glass approaches the edge of the page. This is because of how the glass contents were painted, on hi resolution screens. Needs regression testing on non-macOS systems.
  2. Default +/- key events were stepping on the main window's +/- events when the magnifier was open. This prevented any of these key events from being consumed. Fixed by toggling off the +/- page events when magnifier is active. Note: if you set your page zoom to some other key combo, it may have worked while magnifier is open, but not after this fix. Not sure if this is an issue or not.
  3. Ignore the page-selection bar at the bottom of the screen when the magnifying glass is active. This didn't show the page selection but it kept the magnifier from reaching the bottom of the page.

Passed clang-format, tested on macOS. I'm happy to make any changes if needed.
AI was used but I Know What I'm Doing™️.

Thank you!

EDIT 2026-07-25: Rewrote the branch to remove the shortcut toggles now that @luisangelsm fixed the issue upstream by changing the default keys. No need to disable the actions any more. I left the other two fixes as they were before.

@luisangelsm

Copy link
Copy Markdown
Member

I changed the default shortcuts here: 57b46fa

I am still not sure if we should disable the actions or not :)

In single-page mode Viewer::grabMagnifiedRegion built the magnified image
with a device pixel ratio of devicePixelRatioF() in the out-of-bounds
branch, while the in-bounds branch returns a DPR-1 image and the source
crop is itself DPR 1. A QPainter draws in logical coordinates, so painting
the DPR-1 crop onto a DPR-2 (Retina) image scaled the content up by the
ratio and clipped it. Because this only happens once the sampled region
touches the page edge, magnification jumped discontinuously near the
left/right edges and edge detail was pushed off the loupe.

Keep the out-of-bounds image at DPR 1 so both branches produce the same
scale.
…tive

With the magnifying glass active, moving the cursor to the bottom of the
page hit the goToFlow page-selection hover zone. The bar did not visibly
appear, but the hover handling took over the mouse events there, so the
magnifying glass stopped following the cursor and could not reach the
bottom of the page. Skip the bottom hover zone while the magnifying glass
is shown.
@starlit-void
starlit-void force-pushed the starlit/magnifier-improvements branch from 2eb2900 to 1241e82 Compare July 25, 2026 08:35
@starlit-void

Copy link
Copy Markdown
Contributor Author

hi @luisangelsm, I removed the action toggles. thanks for the upstream fix!!

@luisangelsm
luisangelsm merged commit da08f0f into YACReader:develop Jul 25, 2026
12 checks passed
@starlit-void
starlit-void deleted the starlit/magnifier-improvements branch July 25, 2026 21:12
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.

2 participants