From eaa9c1580a45b9bba11840c08d22663398dd71f3 Mon Sep 17 00:00:00 2001 From: 00JCIV00 Date: Tue, 20 Aug 2024 11:13:58 -0400 Subject: [PATCH] widgets(table): fixed an issue w/ active row contents causing the last few rows to disappear --- src/widgets/Table.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/Table.zig b/src/widgets/Table.zig index 44c42f5..54552eb 100644 --- a/src/widgets/Table.zig +++ b/src/widgets/Table.zig @@ -235,7 +235,7 @@ pub fn drawTable( const max_items = if (data_items.len > table_win.height -| 1) table_win.height -| 1 else data_items.len; var end = table_ctx.start + max_items; - if (table_ctx.row + table_ctx.active_y_off >= end -| 1) + if (table_ctx.row + table_ctx.active_y_off >= win.height -| 2) end -|= table_ctx.active_y_off; if (end > data_items.len) end = data_items.len; table_ctx.start = tableStart: { @@ -250,7 +250,7 @@ pub fn drawTable( break :tableStart table_ctx.start; }; end = table_ctx.start + max_items; - if (table_ctx.row + table_ctx.active_y_off >= end -| 1) + if (table_ctx.row + table_ctx.active_y_off >= win.height -| 2) end -|= table_ctx.active_y_off; if (end > data_items.len) end = data_items.len; table_ctx.start = @min(table_ctx.start, end);