Skip to content

Magnifying glass improvements (macOS)#566

Open
starlit-void wants to merge 3 commits into
YACReader:developfrom
starlit-void:starlit/magnifier-improvements
Open

Magnifying glass improvements (macOS)#566
starlit-void wants to merge 3 commits into
YACReader:developfrom
starlit-void:starlit/magnifier-improvements

Conversation

@starlit-void

Copy link
Copy Markdown

Three 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!

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.
The magnifying glass size actions and the page zoom actions both default
to + and -. While the magnifying glass is visible both sets were enabled,
making those shortcuts ambiguous so neither fired (the glass zoom */_ and
reset / kept working because they are unique).

Disable the page zoom actions while the magnifying glass is visible so its
size actions own + and -.
…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.
@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 :)

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