From 88f518f7c1d5ebbf4c5fbe2690cb98439f027914 Mon Sep 17 00:00:00 2001 From: TheOddGarlic Date: Sun, 1 May 2022 18:29:36 +0300 Subject: [PATCH] fix: Column now restores previous Y position This patch fixes the bug where positioning is all wonky after having rendered a Column, because Column didn't restore the previous Y position. Similar bugs probably will occur but this is the first one I catched. --- src/widget/column.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widget/column.rs b/src/widget/column.rs index ed025c8..5a22985 100755 --- a/src/widget/column.rs +++ b/src/widget/column.rs @@ -15,6 +15,7 @@ pub struct Column { impl Widget for Column { fn draw(&self, renderer: &mut Renderer) { + let (_, prev_y) = renderer.position(); self.widgets.iter().for_each(|widget| { let pos = widget.position(renderer); renderer.position_at( @@ -27,6 +28,8 @@ impl Widget for Column { renderer.position().1 + pos.height() ); }); + + renderer.position_at(renderer.position().0, prev_y); } fn position(&self, renderer: &mut Renderer) -> Position {