Commit ed65e976 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak Committed by Guido Gunther

PhoshHome: Fix jumping position when reversing an active animation

`1.0 - self->animation.progress` assumes linear interpolation; however,
cubic ease out is used for animating home view position, so the new
reversed position needs to be adjusted for that in order to start from
the same place on the screen.
parent 1fd951a8
Pipeline #64426 passed with stages
in 41 minutes and 50 seconds
......@@ -472,6 +472,13 @@ animate_cb(GtkWidget *widget,
}
static double
reverse_ease_out_cubic (double t)
{
return cbrt(t - 1) + 1;
}
/**
* phosh_home_set_state:
* @self: The home surface
......@@ -499,7 +506,7 @@ phosh_home_set_state (PhoshHome *self, PhoshHomeState state)
g_debug ("Setting state to %s", state_name);
self->animation.last_frame = -1;
self->animation.progress = enable_animations ? (1.0 - self->animation.progress) : 1.0;
self->animation.progress = enable_animations ? reverse_ease_out_cubic (1.0 - hdy_ease_out_cubic (self->animation.progress)) : 1.0;
gtk_widget_add_tick_callback (GTK_WIDGET (self), animate_cb, NULL, NULL);
if (state == PHOSH_HOME_STATE_UNFOLDED) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment