fix: Aplicar clipping a headers de tabla, no solo contenido

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 <noreply@anthropic.com>
This commit is contained in:
reugenio 2025-12-12 00:07:29 +01:00
parent f3cdb213cf
commit e56d3bd1a7

View file

@ -143,6 +143,10 @@ pub fn tableRectFull(
const content_h = bounds.h -| header_h; const content_h = bounds.h -| header_h;
const visible_rows: usize = @intCast(content_h / config.row_height); 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 // Draw header if enabled
if (config.show_headers) { if (config.show_headers) {
const header_result = render.drawHeader(ctx, bounds, table_state, columns, state_col_w, config, colors); 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 // Calculate visible row range
const first_visible = table_state.scroll_row; const first_visible = table_state.scroll_row;
const last_visible = @min(first_visible + visible_rows, table_state.row_count); const last_visible = @min(first_visible + visible_rows, table_state.row_count);