From: Matthias Clasen Date: Mon, 18 Oct 2021 20:45:10 +0000 (-0400) Subject: css: Fix handling of percentage for line-height X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~5^2~227^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c80e877c28f292081faa205c28ded90649a4147f;p=gtk4.git css: Fix handling of percentage for line-height We weren't doing the right thing here. This is simpler, and works. Fixes: #4354 --- diff --git a/gtk/gtkcsslineheightvalue.c b/gtk/gtkcsslineheightvalue.c index c9104cee24..4472f503bc 100644 --- a/gtk/gtkcsslineheightvalue.c +++ b/gtk/gtkcsslineheightvalue.c @@ -52,19 +52,11 @@ gtk_css_value_line_height_compute (GtkCssValue *value, if (gtk_css_number_value_get_dimension (height) == GTK_CSS_DIMENSION_PERCENTAGE) { double factor; - GtkCssValue *val; GtkCssValue *computed; - factor = _gtk_css_number_value_get (height, 1); - val = gtk_css_dimension_value_new (factor, GTK_CSS_EM); + factor = _gtk_css_number_value_get (height, 1); + computed = gtk_css_number_value_multiply (style->core->font_size, factor); - computed = _gtk_css_value_compute (val, - GTK_CSS_PROPERTY_FONT_SIZE, - provider, - style, - parent_style); - - _gtk_css_value_unref (val); _gtk_css_value_unref (height); return computed;