]> Pileus Git - ~andy/gtk/commitdiff
Forgotten fix.
authorMatthias Clasen <matthiasc@src.gnome.org>
Sun, 8 May 2005 05:46:45 +0000 (05:46 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 8 May 2005 05:46:45 +0000 (05:46 +0000)
gdk/gdkpango.c

index a5801fcbfed488becc0fc1c055a559885447b2e7..4a266762b535c3b35fc04965b76ac5b30783021e 100644 (file)
@@ -984,7 +984,7 @@ gdk_draw_layout_with_colors (GdkDrawable     *drawable,
     }
   else
     pango_renderer_set_matrix (renderer, NULL);
-  
+
   pango_renderer_draw_layout (renderer, layout, x * PANGO_SCALE, y * PANGO_SCALE);
   
   release_renderer (renderer);
@@ -1235,12 +1235,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);
+      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++)
+      for (j = 0; j < n_pixel_ranges; j++)
         {
           GdkRectangle rect;