From 0dde01e199434944a64b20ca23abbdf77a501c17 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak <dos@dosowisko.net> Date: Tue, 22 Aug 2023 15:15:29 +0200 Subject: [PATCH] gr33nhouse: Don't render invisible entries in the applist Improves rendering performance with current app list size from 3-4 FPS to 8-10 FPS. --- python_payload/apps/gr33nhouse/applist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_payload/apps/gr33nhouse/applist.py b/python_payload/apps/gr33nhouse/applist.py index 917bc6f1da..e82104fcd1 100644 --- a/python_payload/apps/gr33nhouse/applist.py +++ b/python_payload/apps/gr33nhouse/applist.py @@ -106,8 +106,9 @@ class AppList(BaseView): else: ctx.gray(1.0) - ctx.move_to(0, offset) - ctx.text(app["name"]) + if abs(self._sc.current_position() - idx) <= 5: + ctx.move_to(0, offset) + ctx.text(app["name"]) offset += 30 ctx.restore() -- GitLab