Skip to content

Commit

Permalink
Update popup.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rustbasic authored Jan 11, 2025
1 parent 9c5332d commit b1831fb
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 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;
Expand Down

0 comments on commit b1831fb

Please sign in to comment.