[libadwaita/wip/exalm/animation-cleanups: 6/8] easing: Add the remaining easing functions from Clutter




commit 4b8fef37e09ccd7ddc0e5a47db01dc285c9596c9
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Nov 22 20:47:58 2021 +0500

    easing: Add the remaining easing functions from Clutter
    
    Since it's now a full enum, no reason not to. Sync the functions with
    Clutter as well, even though we don't use the `d` parameter.

 demo/adw-demo-window.c    |  57 ++++++
 src/adw-easing.c          | 473 ++++++++++++++++++++++++++++++++++++++++++++--
 src/adw-easing.h          |  28 +++
 src/adw-timed-animation.c |   4 +-
 4 files changed, 541 insertions(+), 21 deletions(-)
---
diff --git a/demo/adw-demo-window.c b/demo/adw-demo-window.c
index 2812ee7a..1030ec9b 100644
--- a/demo/adw-demo-window.c
+++ b/demo/adw-demo-window.c
@@ -450,12 +450,69 @@ animations_easing_name (AdwEnumListItem *value,
   g_return_val_if_fail (ADW_IS_ENUM_LIST_ITEM (value), NULL);
 
   switch (adw_enum_list_item_get_value (value)) {
+  case ADW_EASING_LINEAR:
+    return g_strdup (_("Linear"));
+
+  case ADW_EASING_EASE_IN_QUAD:
+    return g_strdup (_("Ease-in (Quadratic)"));
+  case ADW_EASING_EASE_OUT_QUAD:
+    return g_strdup (_("Ease-out (Quadratic)"));
+  case ADW_EASING_EASE_IN_OUT_QUAD:
+    return g_strdup (_("Ease-in-out (Quadratic)"));
   case ADW_EASING_EASE_IN_CUBIC:
     return g_strdup (_("Ease-in (Cubic)"));
   case ADW_EASING_EASE_OUT_CUBIC:
     return g_strdup (_("Ease-out (Cubic)"));
   case ADW_EASING_EASE_IN_OUT_CUBIC:
     return g_strdup (_("Ease-in-out (Cubic)"));
+  case ADW_EASING_EASE_IN_QUART:
+    return g_strdup (_("Ease-in (Quartic)"));
+  case ADW_EASING_EASE_OUT_QUART:
+    return g_strdup (_("Ease-out (Quartic)"));
+  case ADW_EASING_EASE_IN_OUT_QUART:
+    return g_strdup (_("Ease-in-out (Quartic)"));
+  case ADW_EASING_EASE_IN_QUINT:
+    return g_strdup (_("Ease-in (Quintic)"));
+  case ADW_EASING_EASE_OUT_QUINT:
+    return g_strdup (_("Ease-out (Quintic)"));
+  case ADW_EASING_EASE_IN_OUT_QUINT:
+    return g_strdup (_("Ease-in-out (Quintic)"));
+  case ADW_EASING_EASE_IN_SINE:
+    return g_strdup (_("Ease-in (Sine)"));
+  case ADW_EASING_EASE_OUT_SINE:
+    return g_strdup (_("Ease-out (Sine)"));
+  case ADW_EASING_EASE_IN_OUT_SINE:
+    return g_strdup (_("Ease-in-out (Sine)"));
+  case ADW_EASING_EASE_IN_EXPO:
+    return g_strdup (_("Ease-in (Exponential)"));
+  case ADW_EASING_EASE_OUT_EXPO:
+    return g_strdup (_("Ease-out (Exponential)"));
+  case ADW_EASING_EASE_IN_OUT_EXPO:
+    return g_strdup (_("Ease-in-out (Exponential)"));
+  case ADW_EASING_EASE_IN_CIRC:
+    return g_strdup (_("Ease-in (Circular)"));
+  case ADW_EASING_EASE_OUT_CIRC:
+    return g_strdup (_("Ease-out (Circular)"));
+  case ADW_EASING_EASE_IN_OUT_CIRC:
+    return g_strdup (_("Ease-in-out (Circular)"));
+  case ADW_EASING_EASE_IN_ELASTIC:
+    return g_strdup (_("Ease-in (Elastic)"));
+  case ADW_EASING_EASE_OUT_ELASTIC:
+    return g_strdup (_("Ease-out (Elastic)"));
+  case ADW_EASING_EASE_IN_OUT_ELASTIC:
+    return g_strdup (_("Ease-in-out (Elastic)"));
+  case ADW_EASING_EASE_IN_BACK:
+    return g_strdup (_("Ease-in (Back)"));
+  case ADW_EASING_EASE_OUT_BACK:
+    return g_strdup (_("Ease-out (Back)"));
+  case ADW_EASING_EASE_IN_OUT_BACK:
+    return g_strdup (_("Ease-in-out (Back)"));
+  case ADW_EASING_EASE_IN_BOUNCE:
+    return g_strdup (_("Ease-in (Bounce)"));
+  case ADW_EASING_EASE_OUT_BOUNCE:
+    return g_strdup (_("Ease-out (Bounce)"));
+  case ADW_EASING_EASE_IN_OUT_BOUNCE:
+    return g_strdup (_("Ease-in-out (Bounce)"));
   default:
     return NULL;
   }
diff --git a/src/adw-easing.c b/src/adw-easing.c
index b62db4d6..e658b77c 100644
--- a/src/adw-easing.c
+++ b/src/adw-easing.c
@@ -8,14 +8,72 @@
 
 #include "adw-easing.h"
 
+#include <math.h>
+
+/*
+ * Copied from:
+ *   
https://gitlab.gnome.org/GNOME/clutter/-/blob/a236494ea7f31848b4a459dad41330f225137832/clutter/clutter-easing.c
+ *   
https://gitlab.gnome.org/GNOME/clutter/-/blob/a236494ea7f31848b4a459dad41330f225137832/clutter/clutter-enums.h
+ */
+
 /**
  * AdwEasing:
- * @ADW_EASING_EASE_IN_CUBIC: Starts slowly and accelerates, cubic curve.
- * @ADW_EASING_EASE_OUT_CUBIC: Starts quickly and decelerates, cubic curve.
- *   This is an inverse of `ADW_EASING_EASE_IN_CUBIC`.
- * @ADW_EASING_EASE_IN_OUT_CUBIC: Starts slowly, accelerates, decelerates and
- *   ends slowly again, combines `ADW_EASING_EASE_IN_CUBIC` and
- *   `ADW_EASING_EASE_OUT_CUBIC`.
+ * @ADW_EASING_LINEAR: Linear tweening.
+ * @ADW_EASING_EASE_IN_QUAD: Quadratic tweening.
+ * @ADW_EASING_EASE_OUT_QUAD: Quadratic tweening, inverse of
+ *   `ADW_EASING_EASE_IN_QUAD`.
+ * @ADW_EASING_EASE_IN_OUT_QUAD: Quadratic tweening, combining
+ *   `ADW_EASING_EASE_IN_QUAD` and `ADW_EASING_EASE_OUT_QUAD`.
+ * @ADW_EASING_EASE_IN_CUBIC: Cubic tweening.
+ * @ADW_EASING_EASE_OUT_CUBIC: Cubic tweening, inverse of
+ *   `ADW_EASING_EASE_IN_CUBIC`.
+ * @ADW_EASING_EASE_IN_OUT_CUBIC: Cubic tweening, combining
+ *   `ADW_EASING_EASE_IN_CUBIC` and `ADW_EASING_EASE_OUT_CUBIC`.
+ * @ADW_EASING_EASE_IN_QUART: Quartic tweening.
+ * @ADW_EASING_EASE_OUT_QUART: Quartic tweening, inverse of
+ *   `ADW_EASING_EASE_IN_QUART`.
+ * @ADW_EASING_EASE_IN_OUT_QUART: Quartic tweening, combining
+ *   `ADW_EASING_EASE_IN_QUART` and `ADW_EASING_EASE_OUT_QUART`.
+ * @ADW_EASING_EASE_IN_QUINT: Quintic tweening.
+ * @ADW_EASING_EASE_OUT_QUINT: Quintic tweening, inverse of
+ *   `ADW_EASING_EASE_IN_QUINT`.
+ * @ADW_EASING_EASE_IN_OUT_QUINT: Quintic tweening, combining
+ *   `ADW_EASING_EASE_IN_QUINT` and `ADW_EASING_EASE_OUT_QUINT`.
+ * @ADW_EASING_EASE_IN_SINE: Sine wave tweening.
+ * @ADW_EASING_EASE_OUT_SINE: Sine wave tweening, inverse of
+ *   `ADW_EASING_EASE_IN_SINE`.
+ * @ADW_EASING_EASE_IN_OUT_SINE: Sine wave tweening, combining
+ *   `ADW_EASING_EASE_IN_SINE` and `ADW_EASING_EASE_OUT_SINE`.
+ * @ADW_EASING_EASE_IN_EXPO: Exponential tweening.
+ * @ADW_EASING_EASE_OUT_EXPO: Exponential tweening, inverse of
+ *   `ADW_EASING_EASE_IN_EXPO`.
+ * @ADW_EASING_EASE_IN_OUT_EXPO: Exponential tweening, combining
+ *   `ADW_EASING_EASE_IN_EXPO` and `ADW_EASING_EASE_OUT_EXPO`.
+ * @ADW_EASING_EASE_IN_CIRC: Circular tweening.
+ * @ADW_EASING_EASE_OUT_CIRC: Circular tweening, inverse of
+ *   `ADW_EASING_EASE_IN_CIRC`.
+ * @ADW_EASING_EASE_IN_OUT_CIRC: Circular tweening, combining
+ *   `ADW_EASING_EASE_IN_CIRC` and `ADW_EASING_EASE_OUT_CIRC`.
+ * @ADW_EASING_EASE_IN_ELASTIC: Elastic tweening, with offshoot on start.
+ * @ADW_EASING_EASE_OUT_ELASTIC: Elastic tweening, with offshoot on end,
+ *   inverse of `ADW_EASING_EASE_IN_ELASTIC`.
+ * @ADW_EASING_EASE_IN_OUT_ELASTIC: Elastic tweening, with offshoot on both
+ *   ends, combining `ADW_EASING_EASE_IN_ELASTIC` and
+ *   `ADW_EASING_EASE_OUT_ELASTIC`.
+ * @ADW_EASING_EASE_IN_BACK: Overshooting cubic tweening, with backtracking on
+ *   start.
+ * @ADW_EASING_EASE_OUT_BACK: Overshooting cubic tweening, with backtracking on
+ *   end, inverse of `ADW_EASING_EASE_IN_BACK`.
+ * @ADW_EASING_EASE_IN_OUT_BACK: Overshooting cubic tweening, with backtracking
+ *   on both ends, combining `ADW_EASING_EASE_IN_BACK` and
+ *   `ADW_EASING_EASE_OUT_BACK`.
+ * @ADW_EASING_EASE_IN_BOUNCE: Exponentially decaying parabolic (bounce)
+ *   tweening, with bounce on start.
+ * @ADW_EASING_EASE_OUT_BOUNCE: Exponentially decaying parabolic (bounce)
+ *   tweening, with bounce on end, inverse of `ADW_EASING_EASE_IN_BOUNCE`.
+ * @ADW_EASING_EASE_IN_OUT_BOUNCE: Exponentially decaying parabolic (bounce)
+ *   tweening, with bounce on both ends, combining `ADW_EASING_EASE_IN_BOUNCE`
+ *   and `ADW_EASING_EASE_OUT_BOUNCE`.
  *
  * Describes the available easing functions for use with
  * [class@Adw.TimedAnimation].
@@ -25,27 +83,68 @@
  * Since: 1.0
  */
 
-/* From clutter-easing.c, based on Robert Penner's
- * infamous easing equations, MIT license.
- */
+static inline double
+linear (double t,
+        double d)
+{
+  return t / d;
+}
 
 static inline double
-ease_out_cubic (double t)
+ease_in_quad (double t,
+              double d)
 {
-  double p = t - 1;
-  return p * p * p + 1;
+  double p = t / d;
+
+  return p * p;
+}
+
+static inline double
+ease_out_quad (double t,
+               double d)
+{
+  double p = t / d;
+
+  return -1.0 * p * (p - 2);
+}
+
+static inline double
+ease_in_out_quad (double t,
+                  double d)
+{
+  double p = t / (d / 2);
+
+  if (p < 1)
+    return 0.5 * p * p;
+
+  p -= 1;
+
+  return -0.5 * (p * (p - 2) - 1);
 }
 
 static inline double
-ease_in_cubic (gdouble t)
+ease_in_cubic (double t,
+               double d)
 {
-  return t * t * t;
+  double p = t / d;
+
+  return p * p * p;
 }
 
 static inline double
-ease_in_out_cubic (double t)
+ease_out_cubic (double t,
+                double d)
 {
-  double p = t * 2;
+  double p = t / d - 1;
+
+  return p * p * p + 1;
+}
+
+static inline double
+ease_in_out_cubic (double t,
+                   double d)
+{
+  double p = t / (d / 2);
 
   if (p < 1)
     return 0.5 * p * p * p;
@@ -55,6 +154,286 @@ ease_in_out_cubic (double t)
   return 0.5 * (p * p * p + 2);
 }
 
+static inline double
+ease_in_quart (double t,
+               double d)
+{
+  double p = t / d;
+
+  return p * p * p * p;
+}
+
+static inline double
+ease_out_quart (double t,
+                double d)
+{
+  double p = t / d - 1;
+
+  return -1.0 * (p * p * p * p - 1);
+}
+
+static inline double
+ease_in_out_quart (double t,
+                   double d)
+{
+  double p = t / (d / 2);
+
+  if (p < 1)
+    return 0.5 * p * p * p * p;
+
+  p -= 2;
+
+  return -0.5 * (p * p * p * p - 2);
+}
+
+static inline double
+ease_in_quint (double t,
+               double d)
+{
+  double p = t / d;
+
+  return p * p * p * p * p;
+}
+
+static inline double
+ease_out_quint (double t,
+                double d)
+{
+  double p = t / d - 1;
+
+  return p * p * p * p * p + 1;
+}
+
+static inline double
+ease_in_out_quint (double t,
+                   double d)
+{
+  double p = t / (d / 2);
+
+  if (p < 1)
+    return 0.5 * p * p * p * p * p;
+
+  p -= 2;
+
+  return 0.5 * (p * p * p * p * p + 2);
+}
+
+static inline double
+ease_in_sine (double t,
+              double d)
+{
+  return -1.0 * cos (t / d * G_PI_2) + 1.0;
+}
+
+static inline double
+ease_out_sine (double t,
+               double d)
+{
+  return sin (t / d * G_PI_2);
+}
+
+static inline double
+ease_in_out_sine (double t,
+                  double d)
+{
+  return -0.5 * (cos (G_PI * t / d) - 1);
+}
+
+static inline double
+ease_in_expo (double t,
+              double d)
+{
+  return (t == 0) ? 0.0 : pow (2, 10 * (t / d - 1));
+}
+
+static double
+ease_out_expo (double t,
+               double d)
+{
+  return (t == d) ? 1.0 : -pow (2, -10 * t / d) + 1;
+}
+
+static inline double
+ease_in_out_expo (double t,
+                  double d)
+{
+  double p;
+
+  if (t == 0)
+    return 0.0;
+
+  if (t == d)
+    return 1.0;
+
+  p = t / (d / 2);
+
+  if (p < 1)
+    return 0.5 * pow (2, 10 * (p - 1));
+
+  p -= 1;
+
+  return 0.5 * (-pow (2, -10 * p) + 2);
+}
+
+static inline double
+ease_in_circ (double t,
+              double d)
+{
+  double p = t / d;
+
+  return -1.0 * (sqrt (1 - p * p) - 1);
+}
+
+static inline double
+ease_out_circ (double t,
+               double d)
+{
+  double p = t / d - 1;
+
+  return sqrt (1 - p * p);
+}
+
+static inline double
+ease_in_out_circ (double t,
+                  double d)
+{
+  double p = t / (d / 2);
+
+  if (p < 1)
+    return -0.5 * (sqrt (1 - p * p) - 1);
+
+  p -= 2;
+
+  return 0.5 * (sqrt (1 - p * p) + 1);
+}
+
+static inline double
+ease_in_elastic (double t,
+                 double d)
+{
+  double p = d * .3;
+  double s = p / 4;
+  double q = t / d;
+
+  if (q == 1)
+    return 1.0;
+
+  q -= 1;
+
+  return -(pow (2, 10 * q) * sin ((q * d - s) * (2 * G_PI) / p));
+}
+
+static inline double
+ease_out_elastic (double t,
+                  double d)
+{
+  double p = d * .3;
+  double s = p / 4;
+  double q = t / d;
+
+  if (q == 1)
+    return 1.0;
+
+  return pow (2, -10 * q) * sin ((q * d - s) * (2 * G_PI) / p) + 1.0;
+}
+
+static inline double
+ease_in_out_elastic (double t,
+                     double d)
+{
+  double p = d * (.3 * 1.5);
+  double s = p / 4;
+  double q = t / (d / 2);
+
+  if (q == 2)
+    return 1.0;
+
+  if (q < 1) {
+    q -= 1;
+
+    return -.5 * (pow (2, 10 * q) * sin ((q * d - s) * (2 * G_PI) / p));
+  } else {
+    q -= 1;
+
+    return pow (2, -10 * q)
+         * sin ((q * d - s) * (2 * G_PI) / p)
+         * .5 + 1.0;
+  }
+}
+
+static inline double
+ease_in_back (double t,
+              double d)
+{
+  double p = t / d;
+
+  return p * p * ((1.70158 + 1) * p - 1.70158);
+}
+
+static inline double
+ease_out_back (double t,
+               double d)
+{
+  double p = t / d - 1;
+
+  return p * p * ((1.70158 + 1) * p + 1.70158) + 1;
+}
+
+static inline double
+ease_in_out_back (double t,
+                  double d)
+{
+  double p = t / (d / 2);
+  double s = 1.70158 * 1.525;
+
+  if (p < 1)
+    return 0.5 * (p * p * ((s + 1) * p - s));
+
+  p -= 2;
+
+  return 0.5 * (p * p * ((s + 1) * p + s) + 2);
+}
+
+static inline double
+ease_out_bounce (double t,
+                 double d)
+{
+  double p = t / d;
+
+  if (p < (1 / 2.75)) {
+    return 7.5625 * p * p;
+  } else if (p < (2 / 2.75)) {
+    p -= (1.5 / 2.75);
+
+    return 7.5625 * p * p + .75;
+  } else if (p < (2.5 / 2.75)) {
+    p -= (2.25 / 2.75);
+
+    return 7.5625 * p * p + .9375;
+  } else {
+    p -= (2.625 / 2.75);
+
+    return 7.5625 * p * p + .984375;
+  }
+}
+
+static inline double
+ease_in_bounce (double t,
+                double d)
+{
+  return 1.0 - ease_out_bounce (d - t, d);
+}
+
+static inline double
+ease_in_out_bounce (double t,
+                    double d)
+{
+  if (t < d / 2)
+    return ease_in_bounce (t * 2, d) * 0.5;
+  else
+    return ease_out_bounce (t * 2 - d, d) * 0.5 + 1.0 * 0.5;
+}
+
 /**
  * adw_easing_ease:
  * @self: a `AdwEasing`
@@ -73,12 +452,68 @@ adw_easing_ease (AdwEasing self,
                  double    value)
 {
   switch (self) {
+    case ADW_EASING_LINEAR:
+      return linear (value, 1);
+    case ADW_EASING_EASE_IN_QUAD:
+      return ease_in_quad (value, 1);
+    case ADW_EASING_EASE_OUT_QUAD:
+      return ease_out_quad (value, 1);
+    case ADW_EASING_EASE_IN_OUT_QUAD:
+      return ease_in_out_quad (value, 1);
     case ADW_EASING_EASE_IN_CUBIC:
-      return ease_in_cubic (value);
+      return ease_in_cubic (value, 1);
     case ADW_EASING_EASE_OUT_CUBIC:
-      return ease_out_cubic (value);
+      return ease_out_cubic (value, 1);
     case ADW_EASING_EASE_IN_OUT_CUBIC:
-      return ease_in_out_cubic (value);
+      return ease_in_out_cubic (value, 1);
+    case ADW_EASING_EASE_IN_QUART:
+      return ease_in_quart (value, 1);
+    case ADW_EASING_EASE_OUT_QUART:
+      return ease_out_quart (value, 1);
+    case ADW_EASING_EASE_IN_OUT_QUART:
+      return ease_in_out_quart (value, 1);
+    case ADW_EASING_EASE_IN_QUINT:
+      return ease_in_quint (value, 1);
+    case ADW_EASING_EASE_OUT_QUINT:
+      return ease_out_quint (value, 1);
+    case ADW_EASING_EASE_IN_OUT_QUINT:
+      return ease_in_out_quint (value, 1);
+    case ADW_EASING_EASE_IN_SINE:
+      return ease_in_sine (value, 1);
+    case ADW_EASING_EASE_OUT_SINE:
+      return ease_out_sine (value, 1);
+    case ADW_EASING_EASE_IN_OUT_SINE:
+      return ease_in_out_sine (value, 1);
+    case ADW_EASING_EASE_IN_EXPO:
+      return ease_in_expo (value, 1);
+    case ADW_EASING_EASE_OUT_EXPO:
+      return ease_out_expo (value, 1);
+    case ADW_EASING_EASE_IN_OUT_EXPO:
+      return ease_in_out_expo (value, 1);
+    case ADW_EASING_EASE_IN_CIRC:
+      return ease_in_circ (value, 1);
+    case ADW_EASING_EASE_OUT_CIRC:
+      return ease_out_circ (value, 1);
+    case ADW_EASING_EASE_IN_OUT_CIRC:
+      return ease_in_out_circ (value, 1);
+    case ADW_EASING_EASE_IN_ELASTIC:
+      return ease_in_elastic (value, 1);
+    case ADW_EASING_EASE_OUT_ELASTIC:
+      return ease_out_elastic (value, 1);
+    case ADW_EASING_EASE_IN_OUT_ELASTIC:
+      return ease_in_out_elastic (value, 1);
+    case ADW_EASING_EASE_IN_BACK:
+      return ease_in_back (value, 1);
+    case ADW_EASING_EASE_OUT_BACK:
+      return ease_out_back (value, 1);
+    case ADW_EASING_EASE_IN_OUT_BACK:
+      return ease_in_out_back (value, 1);
+    case ADW_EASING_EASE_IN_BOUNCE:
+      return ease_in_bounce (value, 1);
+    case ADW_EASING_EASE_OUT_BOUNCE:
+      return ease_out_bounce (value, 1);
+    case ADW_EASING_EASE_IN_OUT_BOUNCE:
+      return ease_in_out_bounce (value, 1);
     default:
       g_assert_not_reached ();
   }
diff --git a/src/adw-easing.h b/src/adw-easing.h
index 39155eb0..af0b74a8 100644
--- a/src/adw-easing.h
+++ b/src/adw-easing.h
@@ -19,9 +19,37 @@
 G_BEGIN_DECLS
 
 typedef enum {
+  ADW_EASING_LINEAR,
+  ADW_EASING_EASE_IN_QUAD,
+  ADW_EASING_EASE_OUT_QUAD,
+  ADW_EASING_EASE_IN_OUT_QUAD,
   ADW_EASING_EASE_IN_CUBIC,
   ADW_EASING_EASE_OUT_CUBIC,
   ADW_EASING_EASE_IN_OUT_CUBIC,
+  ADW_EASING_EASE_IN_QUART,
+  ADW_EASING_EASE_OUT_QUART,
+  ADW_EASING_EASE_IN_OUT_QUART,
+  ADW_EASING_EASE_IN_QUINT,
+  ADW_EASING_EASE_OUT_QUINT,
+  ADW_EASING_EASE_IN_OUT_QUINT,
+  ADW_EASING_EASE_IN_SINE,
+  ADW_EASING_EASE_OUT_SINE,
+  ADW_EASING_EASE_IN_OUT_SINE,
+  ADW_EASING_EASE_IN_EXPO,
+  ADW_EASING_EASE_OUT_EXPO,
+  ADW_EASING_EASE_IN_OUT_EXPO,
+  ADW_EASING_EASE_IN_CIRC,
+  ADW_EASING_EASE_OUT_CIRC,
+  ADW_EASING_EASE_IN_OUT_CIRC,
+  ADW_EASING_EASE_IN_ELASTIC,
+  ADW_EASING_EASE_OUT_ELASTIC,
+  ADW_EASING_EASE_IN_OUT_ELASTIC,
+  ADW_EASING_EASE_IN_BACK,
+  ADW_EASING_EASE_OUT_BACK,
+  ADW_EASING_EASE_IN_OUT_BACK,
+  ADW_EASING_EASE_IN_BOUNCE,
+  ADW_EASING_EASE_OUT_BOUNCE,
+  ADW_EASING_EASE_IN_OUT_BOUNCE,
 } AdwEasing;
 
 ADW_AVAILABLE_IN_ALL
diff --git a/src/adw-timed-animation.c b/src/adw-timed-animation.c
index 96b7bd94..2f32d8f2 100644
--- a/src/adw-timed-animation.c
+++ b/src/adw-timed-animation.c
@@ -529,7 +529,7 @@ AdwEasing
 adw_timed_animation_get_easing (AdwTimedAnimation *self)
 {
   g_return_val_if_fail (ADW_IS_TIMED_ANIMATION (self),
-                        ADW_EASING_EASE_IN_CUBIC);
+                        ADW_EASING_LINEAR);
 
   return self->easing;
 }
@@ -551,7 +551,7 @@ adw_timed_animation_set_easing (AdwTimedAnimation *self,
                                 AdwEasing          easing)
 {
   g_return_if_fail (ADW_IS_TIMED_ANIMATION (self));
-  g_return_if_fail (easing <= ADW_EASING_EASE_IN_OUT_CUBIC);
+  g_return_if_fail (easing <= ADW_EASING_EASE_IN_OUT_BOUNCE);
 
   if (self->easing == easing)
     return;


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