diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rs index e7526dfa3a74d444bf6747d51a8b98a1de85d9cf..9ee9eaa7c335960f3e3c6974b0a8798c3d13f9c4 100644 --- a/crates/gpui2/src/element.rs +++ b/crates/gpui2/src/element.rs @@ -246,12 +246,15 @@ where fn draw( &mut self, - origin: Point, + mut origin: Point, available_space: Size, view_state: &mut V, cx: &mut ViewContext, ) { self.measure(available_space, view_state, cx); + // Ignore the element offset when drawing this element, as the origin is already specified + // in absolute terms. + origin -= cx.element_offset(); cx.with_element_offset(Some(origin), |cx| self.paint(view_state, cx)) } }