Skip to content

fix: a11y: magnifier: change ZoomState::update_focal_point to use f64 to avoid rounding errors - #2516

Merged
Drakulix merged 1 commit into
pop-os:masterfrom
dra11y:fix-magnifier-center-movement
Jul 1, 2026
Merged

Drakulix merged 1 commit into
pop-os:masterfrom
dra11y:fix-magnifier-center-movement

Conversation

@tgrushka

@tgrushka tgrushka commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes #2515 (erratic cursor movement in magnifier when Zoomed view moves mode is To keep pointer centered -- ZoomMovement::Centered).

Please see the issue for full description and screen recording.

By changing the coordinate calculations in ZoomState::update_focal_point from i32 to f64, we avoid:

  • truncating integer division that results in miscalculation of the focal point;
  • potential other edge cases related to the same issue.

Tagging @Drakulix and @leviport , thanks for your help with my last PR!

Screen recording of fix

Attached in comment...

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

@leviport
leviport requested review from a team June 30, 2026 22:37
@leviport leviport self-assigned this Jun 30, 2026
@tgrushka

Copy link
Copy Markdown
Contributor Author

Here is my test recording of fix.

recording-1782858918_downscaled.mp4

@leviport leviport left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is working great, thanks!

Before:

Kooha-2026-06-30-16-32-39.webm

After:

Kooha-2026-06-30-19-10-18.webm

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@Drakulix
Drakulix merged commit c5775d2 into pop-os:master Jul 1, 2026
9 of 10 checks passed
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.

Accessibility: When Magnifier in "To keep pointer centered" movement mode, zoomed more than 2X, pointer behaves erratically

3 participants