From e56d3bd1a7479be4d00b495b519073b1a600ccec Mon Sep 17 00:00:00 2001 From: reugenio Date: Fri, 12 Dec 2025 00:07:29 +0100 Subject: [PATCH] fix: Aplicar clipping a headers de tabla, no solo contenido MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El clip se aplicaba solo al área de contenido (excluyendo header), lo que permitía que el texto de los headers se extendiera fuera de los límites de la tabla. Ahora el clip abarca toda la tabla (bounds completos) antes de dibujar headers y contenido. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/widgets/table/table.zig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/widgets/table/table.zig b/src/widgets/table/table.zig index 7af2832..7248146 100644 --- a/src/widgets/table/table.zig +++ b/src/widgets/table/table.zig @@ -143,6 +143,10 @@ pub fn tableRectFull( const content_h = bounds.h -| header_h; const visible_rows: usize = @intCast(content_h / config.row_height); + // Begin clipping to entire table bounds + // This prevents header and cell text from drawing outside the table area + ctx.pushCommand(Command.clip(bounds.x, bounds.y, bounds.w, bounds.h)); + // Draw header if enabled if (config.show_headers) { const header_result = render.drawHeader(ctx, bounds, table_state, columns, state_col_w, config, colors); @@ -153,11 +157,6 @@ pub fn tableRectFull( } } - // Begin clipping to table content area (excludes header) - // This prevents cell text from drawing outside the table bounds - const content_y = bounds.y + @as(i32, @intCast(header_h)); - ctx.pushCommand(Command.clip(bounds.x, content_y, bounds.w, content_h)); - // Calculate visible row range const first_visible = table_state.scroll_row; const last_visible = @min(first_visible + visible_rows, table_state.row_count);