commit 6e4d4e1c68bdb032581973f3051799e1be6b5a50
parent b25cfce10d385976da4d961a6158a3c1216aa7fc
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Sat, 21 Aug 2021 20:30:12 +0000
slighlty optimize drawing routine
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/richterm.c b/richterm.c
@@ -569,7 +569,11 @@ drawchar(Object *obj, long n, Point *cur)
cur->x = (cur->x / tab + 1) * tab;
break;
default:
- _drawchar(p, *cur, obj->font, Itext, Inormbg);
+ if ((cur->y >= rich.page.scroll.y) &&
+ (obj->nextlinept.y <= rich.page.scroll.y + Dy(rich.page.r)))
+ {
+ _drawchar(p, *cur, obj->font, Itext, Inormbg);
+ }
cur->x += cw;
}
}