From ba516ae78362dfc74d2e564953af8f17ab66828c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 7 Apr 2005 05:38:05 +0000 Subject: [PATCH] Ignore regions which fall completely outside the line. (#165862, Felipe 2005-04-07 Matthias Clasen * gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): Ignore regions which fall completely outside the line. (#165862, Felipe Heidrich) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gdk/gdkpango.c | 14 ++++++++------ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81c81d8514..4fe05e8323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-04-07 Matthias Clasen + + * gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): + Ignore regions which fall completely outside the line. + (#165862, Felipe Heidrich) + 2005-04-06 Matthias Clasen * gtk/*.c, gdk/gdkdisplaymanager.c: s/G-OBJECT/G_OBJECT/g, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 81c81d8514..4fe05e8323 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-04-07 Matthias Clasen + + * gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): + Ignore regions which fall completely outside the line. + (#165862, Felipe Heidrich) + 2005-04-06 Matthias Clasen * gtk/*.c, gdk/gdkdisplaymanager.c: s/G-OBJECT/G_OBJECT/g, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 81c81d8514..4fe05e8323 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-04-07 Matthias Clasen + + * gdk/gdkpango.c (gdk_pango_layout_line_get_clip_region): + Ignore regions which fall completely outside the line. + (#165862, Felipe Heidrich) + 2005-04-06 Matthias Clasen * gtk/*.c, gdk/gdkdisplaymanager.c: s/G-OBJECT/G_OBJECT/g, diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c index d317b0faab..c5d2dedd5f 100644 --- a/gdk/gdkpango.c +++ b/gdk/gdkpango.c @@ -1316,12 +1316,14 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line, /* Note that get_x_ranges returns layout coordinates */ - pango_layout_line_get_x_ranges (line, - index_ranges[i*2], - index_ranges[i*2+1], - &pixel_ranges, &n_pixel_ranges); - - for (j=0; j < n_pixel_ranges; j++) + if (index_ranges[i*2+1] >= line->start_index && + index_ranges[i*2] < line->start_index + line->length) + pango_layout_line_get_x_ranges (line, + index_ranges[i*2], + index_ranges[i*2+1], + &pixel_ranges, &n_pixel_ranges); + + for (j = 0; j < n_pixel_ranges; j++) { GdkRectangle rect;