render: fix missed clipping test in dtext()

This commit is contained in:
Lephe 2022-11-19 23:41:47 +01:00
parent 5461d54083
commit 8442e0b9cf
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
2 changed files with 3 additions and 1 deletions

View file

@ -59,7 +59,6 @@ static void topti_render(int x, int y, char const *str_char, font_t const *f,
/* Vertical clipping */
if(x >= dwindow.right || y >= dwindow.bottom) return;
if(y + height <= dwindow.top) return;
height = min(height, dwindow.bottom - y);
int top_overflow = y - dwindow.top;
if(top_overflow < 0) {
@ -67,6 +66,8 @@ static void topti_render(int x, int y, char const *str_char, font_t const *f,
height += top_overflow;
y -= top_overflow;
}
height = min(height, dwindow.bottom - y);
if(height <= 0) return;
/* Move to top row */
uint16_t *target = gint_vram + DWIDTH * y;

View file

@ -109,6 +109,7 @@ void topti_render(int x, int y, char const *str_char, font_t const *f,
vdisp = dwindow.top - y;
y = dwindow.top;
}
if(vdisp >= height) return;
uint32_t bg_mask[4];
masks(dwindow.left, dwindow.right, bg_mask);