diff --git a/tui/src/tui_content.rs b/tui/src/tui_content.rs index 51cf7b3f..9a0ad1ad 100644 --- a/tui/src/tui_content.rs +++ b/tui/src/tui_content.rs @@ -5,7 +5,8 @@ impl Content for &str { to.center_xy([self.chars().count() as u16, 1]) } fn render (&self, to: &mut TuiOut) { - to.blit(self, to.area.x(), to.area.y(), None) + let [x, y, ..] = Content::layout(self, to.area()); + to.blit(self, x, y, None) } } @@ -14,7 +15,8 @@ impl Content for String { to.center_xy([self.chars().count() as u16, 1]) } fn render (&self, to: &mut TuiOut) { - to.blit(self, to.area.x(), to.area.y(), None) + let [x, y, ..] = Content::layout(self, to.area()); + to.blit(self, x, y, None) } }