Skip to content

Commit

Permalink
fix: 🐛 Fix event tooltip scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Sep 1, 2023
1 parent 133420f commit fc7e7e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/map_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ impl MapView {
response = response.on_hover_ui_at_pointer(|ui| {
ui.label(format!("Event {:0>3}: {:?}", event.id, event.name));

let (response, painter) =
ui.allocate_painter(event_size, egui::Sense::click());
let (response, painter) = ui.allocate_painter(
event_size * ui.ctx().pixels_per_point(),
egui::Sense::click(),
);
if let Some(sprite) = sprite {
sprite.paint(&painter, response.rect);
}
Expand Down

0 comments on commit fc7e7e5

Please sign in to comment.