mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 23:24:16 +00:00
css: Allow transitioning between different units again
This turns out to be necessary for transitioning filters,
and we run into criticals if transitioning numbers
unexpectedly returns NULL. I've observed that with
* {
filter: invert(80%);
}
This was broken in c9e972eecb
.
This commit is contained in:
parent
ef8e8ba14d
commit
a7cad79092
@ -248,10 +248,10 @@ gtk_css_value_dimension_transition (GtkCssValue *start,
|
|||||||
guint property_id,
|
guint property_id,
|
||||||
double progress)
|
double progress)
|
||||||
{
|
{
|
||||||
if (start->unit != end->unit)
|
if (start->unit == end->unit)
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return gtk_css_dimension_value_new (start->value + (end->value - start->value) * progress, start->unit);
|
return gtk_css_dimension_value_new (start->value + (end->value - start->value) * progress, start->unit);
|
||||||
|
|
||||||
|
return gtk_css_number_value_transition (start, end, property_id, progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GtkCssNumberValueClass GTK_CSS_VALUE_DIMENSION = {
|
static const GtkCssNumberValueClass GTK_CSS_VALUE_DIMENSION = {
|
||||||
|
Loading…
Reference in New Issue
Block a user