emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
22.51k stars 1.61k forks source link

Always compute pointer position with current zoom #5380

Open timstr opened 5 days ago

timstr commented 5 days ago

This addresses out-of-date pointer positions during changing zoom factors by performing the same zoom-based scaling per-frame when the current zoom factor is known, rather than baking in the zoom factor during the most recent pointer move.

Before:

Screencast from 2024-11-16 04:09:08 PM.webm

After:

Screencast from 2024-11-16 04:13:54 PM.webm

See https://github.com/emilk/egui/issues/5379 for discussion and more details

github-actions[bot] commented 5 days ago

Preview available at https://egui-pr-preview.github.io/pr/5380-pointer_current_zoom Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.