summaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2026-03-08 10:12:57 -0700
committer3gg <3gg@shellblade.net>2026-03-08 10:13:29 -0700
commit89188be968ac39e0e12077e6b596efaf00d06986 (patch)
tree725b290d574f6a284631a4c70e4212031420751c /src/render.c
parent7f2987db18e515aec099a281fb4499fad8ffd4e0 (diff)
Store strings inside table cells for simplicity
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/render.c b/src/render.c
index f716e1a..2d3764a 100644
--- a/src/render.c
+++ b/src/render.c
@@ -163,7 +163,6 @@ static void RenderText(const char* text, size_t length, RenderState* state) {
163/// Render a frame. 163/// Render a frame.
164static void RenderFrame(const uiFrame* frame, RenderState* state) { 164static void RenderFrame(const uiFrame* frame, RenderState* state) {
165 assert(frame); 165 assert(frame);
166
167 FillRect(&frame->widget.rect, uiBlack, state); 166 FillRect(&frame->widget.rect, uiBlack, state);
168} 167}
169 168
@@ -171,7 +170,6 @@ static void RenderFrame(const uiFrame* frame, RenderState* state) {
171static void RenderLabel(const uiLabel* label, RenderState* state) { 170static void RenderLabel(const uiLabel* label, RenderState* state) {
172 assert(label); 171 assert(label);
173 assert(state); 172 assert(state);
174
175 RenderText(string_data(label->text), string_length(label->text), state); 173 RenderText(string_data(label->text), string_length(label->text), state);
176} 174}
177 175
@@ -198,7 +196,7 @@ static void RenderTable(const uiTable* table, RenderState* state) {
198 &original_subsurface, &original_pen); 196 &original_subsurface, &original_pen);
199 197
200 const uiCell* cell = &table->header[col]; 198 const uiCell* cell = &table->header[col];
201 RenderWidget(state, cell->child); 199 RenderText(string_data(cell->text), string_length(cell->text), state);
202 200
203 // Reset the original subsurface and pen for subsequent columns. 201 // Reset the original subsurface and pen for subsequent columns.
204 PopSubsurface(state, &original_subsurface, &original_pen); 202 PopSubsurface(state, &original_subsurface, &original_pen);
@@ -228,7 +226,7 @@ static void RenderTable(const uiTable* table, RenderState* state) {
228 state->pen.x = 0; 226 state->pen.x = 0;
229 227
230 const uiCell* cell = GetCell(table, row, col); 228 const uiCell* cell = GetCell(table, row, col);
231 RenderWidget(state, cell->child); 229 RenderText(string_data(cell->text), string_length(cell->text), state);
232 230
233 // Reset the original subsurface and pen for subsequent columns. 231 // Reset the original subsurface and pen for subsequent columns.
234 PopSubsurface(state, &original_subsurface, &original_pen); 232 PopSubsurface(state, &original_subsurface, &original_pen);