[libadwaita/wip/exalm/tabs: 26/34] 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: 26/34] animation: Add adw_ease_in_out_cubic()
- Date: Fri, 2 Apr 2021 11:02:24 +0000 (UTC)
commit 90f2a52c26f9d2a3e43da1b43848522f3f323bb0
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 9a16928..cf6f401 100644
--- a/src/adw-animation.c
+++ b/src/adw-animation.c
@@ -254,3 +254,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]