From 555d1cff30123cb5a57774a66ad052f3aa62fd27 Mon Sep 17 00:00:00 2001 From: non-npc <101848445+non-npc@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:02:09 -0400 Subject: [PATCH] Update hover_animation.py ensure that the value of pb.value does not go below zero --- python/community/flet_animations/hover_animation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/community/flet_animations/hover_animation.py b/python/community/flet_animations/hover_animation.py index 744e9d64..c9246133 100644 --- a/python/community/flet_animations/hover_animation.py +++ b/python/community/flet_animations/hover_animation.py @@ -12,8 +12,9 @@ def on_exit(): width=page.width; for i in range(100): time.sleep(0.001); - pb.value-=0.01; - page.update(); + if pb.value > 0: + pb.value -= 0.01 + page.update() page.horizontal_alignment = page.vertical_alignment = "center"; progress_bar=pb = ft.ProgressBar(width=185, value=0, color="amber", bgcolor="#eeeeee"); exp=ft.Column(alignment="center", controls=[ft.Row(alignment="center", controls=[ft.Column(controls=[ft.GestureDetector(