Re: Pango change broke GtkFB
- From: Owen Taylor <otaylor redhat com>
- To: gtk-devel-list gnome org
- Cc: Alexander Larsson <alla lysator liu se>
- Subject: Re: Pango change broke GtkFB
- Date: 14 Nov 2000 09:20:04 -0500
Alexander Larsson <alla lysator liu se> writes:
> I don't know much about pango, so i don't know why this happened, but I
> needed this to not crash when running GtkFB:
Could you try the following patch instead and see if it fixes the
problem?
Thanks,
Owen
Index: pango-layout.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-layout.c,v
retrieving revision 1.42
diff -u -r1.42 pango-layout.c
--- pango-layout.c 2000/11/14 01:02:05 1.42
+++ pango-layout.c 2000/11/14 14:18:54
@@ -2868,22 +2868,29 @@
PangoRectangle shape_ink;
PangoRectangle shape_logical;
+ PangoRectangle tmp_ink;
gboolean shape_set;
+ gboolean need_ink;
pango_layout_get_item_properties (run->item, &uline,
&shape_ink, &shape_logical, &shape_set);
if (shape_setp)
*shape_setp = shape_set;
+
+ need_ink = run_ink || uline == PANGO_UNDERLINE_LOW;
if (shape_set)
imposed_extents (run->item->num_chars, &shape_ink, &shape_logical,
- (uline != PANGO_UNDERLINE_NONE) ? run_ink : NULL, run_logical);
+ need_ink ? &tmp_ink : NULL, run_logical);
else
pango_glyph_string_extents (run->glyphs, run->item->analysis.font,
- (uline != PANGO_UNDERLINE_NONE) ? run_ink : NULL,
+ need_ink ? &tmp_ink : NULL,
run_logical);
+ if (run_ink)
+ *run_ink = tmp_ink;
+
switch (uline)
{
case PANGO_UNDERLINE_NONE:
@@ -2899,12 +2906,10 @@
run_logical->height = MAX (run_logical->height, 4 * PANGO_SCALE - run_logical->y);
break;
case PANGO_UNDERLINE_LOW:
- if (run_ink)
- run_ink->height += 2 * PANGO_SCALE;
-
/* FIXME: Should this simply be run_logical->height += 2 * PANGO_SCALE instead?
*/
- run_logical->height = MAX (run_logical->height, run_ink->y + run_ink->height - run_logical->y);
+ run_logical->height = MAX (run_logical->height,
+ tmp_ink.y + tmp_ink.height + 2 * PANGO_SCALE - run_logical->y);
break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]