summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stensgård <mastensg@mastensg.net>2025-07-06 23:27:26 +0200
committerMartin Stensgård <mastensg@mastensg.net>2025-07-06 23:27:26 +0200
commitccb4cbedf1acc04174711ba6c06efad56a6665f7 (patch)
treeda3e144267a928de770cd6ecc491780c81a0af5d
parent9de4e2171c761adcd51f9c9b1d3f7aa6e47b89ec (diff)
opplysning: stop drawing events before exceeding bottom of screen
-rw-r--r--opplysning.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/opplysning.c b/opplysning.c
index cfc0009..0f8b338 100644
--- a/opplysning.c
+++ b/opplysning.c
@@ -224,6 +224,8 @@ draw_events(int x, int y, size_t numevents,
for (size_t i = 0; i < numevents; ++i) {
const struct event *e = &events[i];
if (year != e->year || month != e->month || day != e->day) {
+ if (SCREEN_H - 2 * R.font_h.baseSize < y)
+ break;
year = e->year;
month = e->month;
day = e->day;