From 3e46f0f074800b3c70f41f9fffbc4b207d6bc2da Mon Sep 17 00:00:00 2001
From: Sebastian Krzyszkowiak <dos@dosowisko.net>
Date: Sat, 4 Nov 2023 02:46:33 +0100
Subject: [PATCH] py,st3m: ViewManager: Don't impose additional delay after
 transition

Since 18f17883bd787e088e60edc93075d551d1d2b9fd, a drawn frame is
guaranteed to reach the screen in a timely manner regardless of whether
the next think call will block for longer or not, so there's no need
to queue additional frames to make sure the animation has visibly
ended before dispatching _done callbacks anymore.
---
 python_payload/st3m/ui/view.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/python_payload/st3m/ui/view.py b/python_payload/st3m/ui/view.py
index ba5237f901..7ccf1dd99a 100644
--- a/python_payload/st3m/ui/view.py
+++ b/python_payload/st3m/ui/view.py
@@ -212,7 +212,7 @@ class ViewManager(Responder):
         self._input = InputController()
 
         self._first_think = False
-        self._fully_drawn = 0
+        self._fully_drawn = False
 
         self._outgoing_wants_to_think = False
 
@@ -235,7 +235,7 @@ class ViewManager(Responder):
         self._transitioning = True
         self._transition = 0.0
         self._first_think = True
-        self._fully_drawn = 0
+        self._fully_drawn = False
         self._direction = self._pending_direction
         self._overriden_vt = self._pending_vt
         self._outgoing = self._incoming
@@ -258,7 +258,7 @@ class ViewManager(Responder):
 
             if self._transition >= 1.0:
                 self._transition = 1.0
-                if self._fully_drawn > 1:
+                if self._fully_drawn:
                     self._end_transition()
 
         if self._input.buttons.os.middle.pressed:
@@ -284,7 +284,7 @@ class ViewManager(Responder):
                 return
 
             if self._transition >= 1.0:
-                self._fully_drawn += 1
+                self._fully_drawn = True
                 ctx.save()
                 self._incoming.draw(ctx)
                 ctx.restore()
-- 
GitLab