[libadwaita/wip/exalm/tabs: 80/88] 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: 80/88] animation: Add adw_ease_in_out_cubic()
- Date: Fri, 7 May 2021 21:07:53 +0000 (UTC)
commit 3d90b310a2b5f8ca13f63631e151b10aab46695d
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 c273580..3e0591a 100644
--- a/src/adw-animation-private.h
+++ b/src/adw-animation-private.h
@@ -47,5 +47,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 fcddea1..0ec6bad 100644
--- a/src/adw-animation.c
+++ b/src/adw-animation.c
@@ -282,3 +282,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]