Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mouse selection accuracy #2304

Merged
merged 6 commits into from
Nov 16, 2022
Merged
4 changes: 2 additions & 2 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ impl Context {
sense: Sense,
enabled: bool,
) -> Response {
let gap = 0.5; // Just to make sure we don't accidentally hover two things at once (a small eps should be sufficient).
let gap = 0.1; // Just to make sure we don't accidentally hover two things at once (a small eps should be sufficient).

// Make it easier to click things:
let interact_rect = rect.expand2(
(0.5 * item_spacing - Vec2::splat(gap))
(0.1 * item_spacing - Vec2::splat(gap))
arshiyasolei marked this conversation as resolved.
Show resolved Hide resolved
.at_least(Vec2::splat(0.0))
.at_most(Vec2::splat(5.0)),
);
Expand Down