diff options
Diffstat (limited to 'src/render.c')
| -rw-r--r-- | src/render.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/render.c b/src/render.c index 20ab142..a242504 100644 --- a/src/render.c +++ b/src/render.c | |||
| @@ -224,7 +224,7 @@ static void RenderTable(const uiTable* table, RenderState* state) { | |||
| 224 | state->subsurface.width = table->widths[col]; | 224 | state->subsurface.width = table->widths[col]; |
| 225 | state->pen.x = 0; | 225 | state->pen.x = 0; |
| 226 | 226 | ||
| 227 | const uiCell* cell = GetCell(table, row, col); | 227 | const uiCell* cell = TableGetCell(table, row, col); |
| 228 | RenderText(string_data(cell->text), string_length(cell->text), state); | 228 | RenderText(string_data(cell->text), string_length(cell->text), state); |
| 229 | 229 | ||
| 230 | // Reset the original subsurface and pen for subsequent columns. | 230 | // Reset the original subsurface and pen for subsequent columns. |
| @@ -242,14 +242,11 @@ static void RenderTable(const uiTable* table, RenderState* state) { | |||
| 242 | if (table->flags.vertical_overflow) { | 242 | if (table->flags.vertical_overflow) { |
| 243 | state->pen.x = col_widths_sum; | 243 | state->pen.x = col_widths_sum; |
| 244 | 244 | ||
| 245 | const int y_start = (int)((double)table->offset / (double)table->rows * | 245 | const uiScrollbar* scrollbar = &table->scrollbar; |
| 246 | (double)table->height); | ||
| 247 | |||
| 248 | const int height = (int)((double)table->num_visible_rows / | ||
| 249 | (double)table->rows * (double)table->height); | ||
| 250 | |||
| 251 | FillRect( | 246 | FillRect( |
| 252 | &(uiRect){.y = y_start, .width = ScrollBarWidth, .height = height}, | 247 | &(uiRect){.y = scrollbar->handle_y, |
| 248 | .width = ScrollbarWidth, | ||
| 249 | .height = scrollbar->handle_height}, | ||
| 253 | uiPink, state); | 250 | uiPink, state); |
| 254 | 251 | ||
| 255 | state->pen.x = x0; | 252 | state->pen.x = x0; |
