|
|
do not draw a row, scrollbar or statusbar if its completely outside the window - sfeed_curses - sfeed curses UI (now part of sfeed, development is in sfeed) |
|
|
 |
git clone git://git.codemadness.org/sfeed_curses (git://git.codemadness.org) |
|
|
 |
Log |
|
|
 |
Files |
|
|
 |
Refs |
|
|
 |
README |
|
|
 |
LICENSE |
|
|
|
--- |
|
|
 |
commit e8baa8ef0f426922b49a941a18fa26f7b6bcc37e |
|
|
 |
parent 3bc8fcc8b261f1b73d8b24d7a3f5cd8e2654ab78 |
|
|
 |
Author: Hiltjo Posthuma <hiltjo@codemadness.org> (mailto://) |
application/vnd.lotus-organizer |
|
|
Date: Wed, 31 Mar 2021 18:13:01 +0200 |
|
|
|
|
|
|
|
do not draw a row, scrollbar or statusbar if its completely outside the window |
|
|
|
|
|
|
|
The drawing of the row outside is reproducable if only 2 "dirty" rows are |
|
|
|
redrawn. |
|
|
|
|
|
|
|
Diffstat: |
|
|
|
M sfeed_curses.c | 7 ++++--- |
|
|
|
|
|
|
|
1 file changed, 4 insertions(+), 3 deletions(-) |
|
|
|
--- |
|
|
 |
diff --git a/sfeed_curses.c b/sfeed_curses.c |
|
|
|
@@ -799,7 +799,8 @@ pane_row_draw(struct pane *p, off_t pos, int selected) |
|
|
|
{ |
|
|
|
struct row *row; |
|
|
|
|
|
|
|
- if (p->hidden || !p->width || !p->height) |
|
|
|
+ if (p->hidden || !p->width || !p->height || |
|
|
|
+ p->x >= win.width || p->y + (pos % p->height) >= win.height) |
|
|
|
return; |
|
|
|
|
|
|
|
row = pane_row_get(p, pos); |
|
|
|
@@ -1024,7 +1025,7 @@ scrollbar_draw(struct scrollbar *s) |
|
|
|
if (!s->dirty) |
|
|
|
return; |
|
|
|
s->dirty = 0; |
|
|
|
- if (s->hidden || !s->size) |
|
|
|
+ if (s->hidden || !s->size || s->x >= win.width || s->y >= win.height) |
|
|
|
return; |
|
|
|
|
|
|
|
cursorsave(); |
|
|
|
@@ -1188,7 +1189,7 @@ statusbar_draw(struct statusbar *s) |
|
|
|
if (!s->dirty) |
|
|
|
return; |
|
|
|
s->dirty = 0; |
|
|
|
- if (s->hidden || !s->width) |
|
|
|
+ if (s->hidden || !s->width || s->x >= win.width || s->y >= win.height) |
|
|
|
return; |
|
|
|
|
|
|
|
cursorsave(); |
|