summaryrefslogtreecommitdiff
path: root/src/ui/listwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/listwidget.c')
-rw-r--r--src/ui/listwidget.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ui/listwidget.c b/src/ui/listwidget.c
index 942c46dd..95a59090 100644
--- a/src/ui/listwidget.c
+++ b/src/ui/listwidget.c
@@ -361,17 +361,18 @@ static void draw_ListWidget_(const iListWidget *d) {
361 /* TODO: This seems to draw two items per each shift of the visible region, even though 361 /* TODO: This seems to draw two items per each shift of the visible region, even though
362 one should be enough. Probably an off-by-one error in the calculation of the 362 one should be enough. Probably an off-by-one error in the calculation of the
363 invalid range. */ 363 invalid range. */
364 iAssert(d->visBuf->buffers[0].texture); 364 iForIndices(i, d->visBuf->buffers) {
365 iAssert(d->visBuf->buffers[1].texture); 365 iAssert(d->visBuf->buffers[i].texture);
366 iAssert(d->visBuf->buffers[2].texture); 366 }
367 const int bg[3] = { w->bgColor, w->bgColor, w->bgColor }; 367 const int bg[iElemCount(d->visBuf->buffers)] = {
368// const int bg[3] = { red_ColorId, magenta_ColorId, blue_ColorId }; 368 w->bgColor, w->bgColor, w->bgColor, w->bgColor
369 };
369 const int bottom = numItems_ListWidget(d) * d->itemHeight; 370 const int bottom = numItems_ListWidget(d) * d->itemHeight;
370 const iRangei vis = { d->scrollY / d->itemHeight * d->itemHeight, 371 const iRangei vis = { d->scrollY / d->itemHeight * d->itemHeight,
371 ((d->scrollY + bounds.size.y) / d->itemHeight + 1) * d->itemHeight }; 372 ((d->scrollY + bounds.size.y) / d->itemHeight + 1) * d->itemHeight };
372 reposition_VisBuf(d->visBuf, vis); 373 reposition_VisBuf(d->visBuf, vis);
373 /* Check which parts are invalid. */ 374 /* Check which parts are invalid. */
374 iRangei invalidRange[3]; 375 iRangei invalidRange[iElemCount(d->visBuf->buffers)];
375 invalidRanges_VisBuf(d->visBuf, (iRangei){ 0, bottom }, invalidRange); 376 invalidRanges_VisBuf(d->visBuf, (iRangei){ 0, bottom }, invalidRange);
376 iForIndices(i, d->visBuf->buffers) { 377 iForIndices(i, d->visBuf->buffers) {
377 iVisBufTexture *buf = &d->visBuf->buffers[i]; 378 iVisBufTexture *buf = &d->visBuf->buffers[i];