From 4ab5fa564d0b804e891a54434103ed6bbb97afe8 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 2 Jan 2024 18:17:26 -0700 Subject: [PATCH] Fix overlay position calculation (but keep rounding) --- crates/gpui2/src/elements/overlay.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/gpui2/src/elements/overlay.rs b/crates/gpui2/src/elements/overlay.rs index 69fe120142..61f24a162b 100644 --- a/crates/gpui2/src/elements/overlay.rs +++ b/crates/gpui2/src/elements/overlay.rs @@ -149,7 +149,9 @@ impl Element for Overlay { desired.origin.y = limits.origin.y; } - cx.with_element_offset(desired.origin - bounds.origin, |cx| { + let mut offset = cx.element_offset() + desired.origin - bounds.origin; + offset = point(offset.x.round(), offset.y.round()); + cx.with_absolute_element_offset(offset, |cx| { cx.break_content_mask(|cx| { for child in &mut self.children { child.paint(cx);