Skip to content

Commit

Permalink
Update popup.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Nov 3, 2024
1 parent 88d5331 commit 8939df5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/egui/src/containers/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ pub fn show_tooltip_at_pointer<R>(

// Add a small exclusion zone around the pointer to avoid tooltips
// covering what we're hovering over.
let mut exclusion_rect = Rect::from_center_size(pointer_pos, Vec2::splat(24.0));
let exclusion_size = Vec2::splat(32.0 * ctx.native_pixels_per_point().unwrap_or(1.0));
let mut exclusion_rect = Rect::from_center_size(pointer_pos, exclusion_size);

// Keep the left edge of the tooltip in line with the cursor:
exclusion_rect.min.x = pointer_pos.x;
Expand Down

0 comments on commit 8939df5

Please sign in to comment.