mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 14:20:21 +00:00
css: Report sizes as absolute
All PangoFontDescriptions that GTK creates now use pango_font_description_set_absolute_size().
This commit is contained in:
parent
e1b6496af7
commit
fba0b359d4
@ -127,10 +127,10 @@ gsk_pango_renderer_show_text_glyphs (PangoRenderer *renderer,
|
||||
return;
|
||||
|
||||
graphene_rect_init (&node_bounds,
|
||||
(float)x/PANGO_SCALE,
|
||||
(float)y/PANGO_SCALE + ink_rect.y,
|
||||
ink_rect.x + ink_rect.width,
|
||||
ink_rect.height);
|
||||
(float)x/PANGO_SCALE - 1.0,
|
||||
(float)y/PANGO_SCALE + ink_rect.y - 1.0,
|
||||
ink_rect.x + ink_rect.width + 2.0,
|
||||
ink_rect.height + 2.0);
|
||||
|
||||
gtk_snapshot_get_offset (crenderer->snapshot, &x_offset, &y_offset);
|
||||
graphene_rect_offset (&node_bounds, x_offset, y_offset);
|
||||
|
@ -1101,7 +1101,6 @@ pack_font_description (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
PangoFontDescription *description;
|
||||
GtkCssValue *v;
|
||||
double dpi;
|
||||
|
||||
description = pango_font_description_new ();
|
||||
|
||||
@ -1112,11 +1111,9 @@ pack_font_description (GtkCssShorthandProperty *shorthand,
|
||||
pango_font_description_set_family (description, _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, 0)));
|
||||
}
|
||||
|
||||
v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("-gtk-dpi"))), query_data);
|
||||
dpi = _gtk_css_number_value_get (v, 96);
|
||||
v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-size"))), query_data);
|
||||
if (v)
|
||||
pango_font_description_set_size (description, round (_gtk_css_number_value_get (v, 100) * PANGO_SCALE * 72 / dpi));
|
||||
pango_font_description_set_absolute_size (description, round (_gtk_css_number_value_get (v, 100) * PANGO_SCALE));
|
||||
|
||||
v = (* query_func) (_gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY (_gtk_style_property_lookup ("font-style"))), query_data);
|
||||
if (v)
|
||||
|
Loading…
Reference in New Issue
Block a user