From 056c0ad794990867f1a2221fcd6b435f3ba5888d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 28 Aug 2020 15:46:50 +0200 Subject: [PATCH] [window] round position to nearest physical pixel, not nearest point --- egui/src/containers/area.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/egui/src/containers/area.rs b/egui/src/containers/area.rs index 5f816558..1e13de86 100644 --- a/egui/src/containers/area.rs +++ b/egui/src/containers/area.rs @@ -131,7 +131,7 @@ impl Area { vel: Vec2::zero(), }); state.pos = fixed_pos.unwrap_or(state.pos); - state.pos = state.pos.round(); + state.pos = ctx.round_pos_to_pixels(state.pos); Prepared { layer, @@ -213,8 +213,7 @@ impl Prepared { ctx.input().screen_size.x - margin, ctx.input().screen_size.y - margin, )); - - state.pos = state.pos.round(); + state.pos = ctx.round_pos_to_pixels(state.pos); // ctx.debug_rect( // Rect::from_min_size(state.pos, state.size),