From 6aacb28a7364e3146c15017c393bf3ddd256f7d8 Mon Sep 17 00:00:00 2001 From: Alexey Shnigir Date: Sun, 9 Feb 2025 17:58:26 +0300 Subject: [PATCH] Fix Y position calculation for layouts with nodes of different height --- druid/extended/layout.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/druid/extended/layout.lua b/druid/extended/layout.lua index dea876b..738630c 100644 --- a/druid/extended/layout.lua +++ b/druid/extended/layout.lua @@ -232,13 +232,14 @@ function M.refresh_layout(self) -- Compare with eps due the float loss and element flickering if current_x + node_width - new_row_width > 0.0001 then + current_y = current_y - row.height - margin.y + if row_index < #rows then row_index = row_index + 1 row = rows[row_index] end current_x = -row.width * (0.5 + layout_pivot_offset.x) - current_y = current_y - row.height - margin.y if is_justify and row.count > 1 then current_x = -max_width * (0.5 + layout_pivot_offset.x) end