mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
animations: Don't set animated values for finished transitions
Otherwise, that value will never get reset and remain frozen in time. This is problematic for example when the value is inherited and the parent changes the value.
This commit is contained in:
parent
f9ddfa28b8
commit
55ade04e11
@ -38,9 +38,7 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation,
|
||||
|
||||
if (transition->start_time >= for_time_us)
|
||||
value = _gtk_css_value_ref (transition->start);
|
||||
else if (transition->end_time <= for_time_us)
|
||||
value = _gtk_css_value_ref (end);
|
||||
else
|
||||
else if (transition->end_time > for_time_us)
|
||||
{
|
||||
progress = (double) (for_time_us - transition->start_time) / (transition->end_time - transition->start_time);
|
||||
progress = _gtk_css_ease_value_transform (transition->ease, progress);
|
||||
@ -52,9 +50,14 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation,
|
||||
if (value == NULL)
|
||||
value = _gtk_css_value_ref (end);
|
||||
}
|
||||
else
|
||||
value = NULL;
|
||||
|
||||
_gtk_css_computed_values_set_animated_value (values, transition->property, value);
|
||||
_gtk_css_value_unref (value);
|
||||
if (value)
|
||||
{
|
||||
_gtk_css_computed_values_set_animated_value (values, transition->property, value);
|
||||
_gtk_css_value_unref (value);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user