From e36c41c77c22eb602b569004773083d22722a6b1 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:22:39 +0900 Subject: [PATCH] Update popup.rs --- crates/egui/src/containers/popup.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/containers/popup.rs b/crates/egui/src/containers/popup.rs index a90e615aca7..3886767fb96 100644 --- a/crates/egui/src/containers/popup.rs +++ b/crates/egui/src/containers/popup.rs @@ -87,7 +87,8 @@ pub fn show_tooltip_at_pointer( // Add a small exclusion zone around the pointer to avoid tooltips // covering what we're hovering over. - let mut pointer_rect = Rect::from_center_size(pointer_pos, Vec2::splat(24.0)); + let exclusion_size = Vec2::splat(48.0 * ctx.native_pixels_per_point().unwrap_or(1.0)); + let mut pointer_rect = Rect::from_center_size(pointer_pos, exclusion_size); // Keep the left edge of the tooltip in line with the cursor: pointer_rect.min.x = pointer_pos.x;