[libadwaita/wip/exalm/tabs: 116/124] animation: Add adw_ease_in_out_cubic()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/tabs: 116/124] animation: Add adw_ease_in_out_cubic()
- Date: Sat, 17 Apr 2021 17:25:47 +0000 (UTC)
commit c8ebe3091627f5190c255597b29819844c8cadb6
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jan 26 20:54:54 2021 +0500
animation: Add adw_ease_in_out_cubic()
src/adw-animation-private.h | 1 +
src/adw-animation.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
---
diff --git a/src/adw-animation-private.h b/src/adw-animation-private.h
index 4554a4a..66d97bf 100644
--- a/src/adw-animation-private.h
+++ b/src/adw-animation-private.h
@@ -46,5 +46,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (AdwAnimation, adw_animation_unref)
double adw_lerp (double a, double b, double t);
double adw_ease_in_cubic (double t);
+double adw_ease_in_out_cubic (double t);
G_END_DECLS
diff --git a/src/adw-animation.c b/src/adw-animation.c
index d3cd1ab..7db291b 100644
--- a/src/adw-animation.c
+++ b/src/adw-animation.c
@@ -274,3 +274,16 @@ adw_ease_in_cubic (gdouble t)
{
return t * t * t;
}
+
+double
+adw_ease_in_out_cubic (double t)
+{
+ double p = t * 2;
+
+ if (p < 1)
+ return 0.5 * p * p * p;
+
+ p -= 2;
+
+ return 0.5 * (p * p * p + 2);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]