forked from AuroraMiddleware/gtk
Cosmetics
Pango lets us pass NULL for the font desc and language in pango_context_get_font_metrics() to use the context values.
This commit is contained in:
parent
a576bd190b
commit
eaf09a4625
@ -1091,9 +1091,7 @@ gtk_image_get_baseline_align (GtkImage *image)
|
|||||||
if (image->baseline_align == 0.0)
|
if (image->baseline_align == 0.0)
|
||||||
{
|
{
|
||||||
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (image));
|
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (image));
|
||||||
metrics = pango_context_get_metrics (pango_context,
|
metrics = pango_context_get_metrics (pango_context, NULL, NULL);
|
||||||
pango_context_get_font_description (pango_context),
|
|
||||||
pango_context_get_language (pango_context));
|
|
||||||
image->baseline_align =
|
image->baseline_align =
|
||||||
(float)pango_font_metrics_get_ascent (metrics) /
|
(float)pango_font_metrics_get_ascent (metrics) /
|
||||||
(pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
|
(pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
|
||||||
|
@ -1039,14 +1039,12 @@ get_char_pixels (GtkWidget *self,
|
|||||||
int char_width, digit_width;
|
int char_width, digit_width;
|
||||||
|
|
||||||
context = pango_layout_get_context (layout);
|
context = pango_layout_get_context (layout);
|
||||||
metrics = pango_context_get_metrics (context,
|
metrics = pango_context_get_metrics (context, NULL, NULL);
|
||||||
pango_context_get_font_description (context),
|
|
||||||
pango_context_get_language (context));
|
|
||||||
char_width = pango_font_metrics_get_approximate_char_width (metrics);
|
char_width = pango_font_metrics_get_approximate_char_width (metrics);
|
||||||
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
|
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
|
||||||
pango_font_metrics_unref (metrics);
|
pango_font_metrics_unref (metrics);
|
||||||
|
|
||||||
return MAX (char_width, digit_width);;
|
return MAX (char_width, digit_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user