[libadwaita/wip/exalm/spring-animation-swipes: 26/36] Cache estimated duration




commit 06688e9a4d80159afb5fc3ede8c8a945153647ac
Author: Manuel Genovés <manuel genoves gmail com>
Date:   Sun Dec 5 19:32:43 2021 +0100

    Cache estimated duration

 src/adw-spring-animation.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-spring-animation.c b/src/adw-spring-animation.c
index 7b67e5f4..dbee8773 100644
--- a/src/adw-spring-animation.c
+++ b/src/adw-spring-animation.c
@@ -120,7 +120,7 @@ get_first_zero (AdwAnimation *animation)
 }
 
 static guint
-adw_spring_animation_estimate_duration (AdwAnimation *animation)
+estimate_duration (AdwAnimation *animation)
 {
   AdwSpringAnimation *self = ADW_SPRING_ANIMATION (animation);
 
@@ -188,11 +188,17 @@ set_estimated_duration (AdwSpringAnimation *self)
   if (!self->spring_params)
     return;
 
-  self->estimated_duration = adw_spring_animation_estimate_duration (ADW_ANIMATION (self));
+  self->estimated_duration = estimate_duration (ADW_ANIMATION (self));
 
   g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ESTIMATED_DURATION]);
 }
 
+static guint 
+adw_spring_animation_estimate_duration (AdwAnimation *self)
+{
+  return ADW_SPRING_ANIMATION (self)->estimated_duration;
+}
+
 static double
 adw_spring_animation_calculate_value (AdwAnimation *animation,
                                       guint         t)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]