[pango/matthiasc/for-main: 3/5] layout: Apply rise to cluster extents




commit 9a9b9a3bc5e4b63c66a06a8361e0c19de22e6868
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 29 18:09:25 2021 -0400

    layout: Apply rise to cluster extents
    
    This has been broken all along. :(

 pango/pango-layout.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 4235b7f3..5aa9ee12 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -7093,6 +7093,8 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter,
                                        PangoRectangle  *ink_rect,
                                        PangoRectangle  *logical_rect)
 {
+  ItemProperties properties;
+
   if (ITER_IS_INVALID (iter))
     return;
 
@@ -7105,6 +7107,8 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter,
       return;
     }
 
+  pango_layout_get_item_properties (iter->run->item, &properties);
+
   pango_glyph_string_extents_range (iter->run->glyphs,
                                     iter->cluster_start,
                                     iter->next_cluster_glyph,
@@ -7115,6 +7119,7 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter,
   if (ink_rect)
     {
       ink_rect->x += iter->cluster_x;
+      ink_rect->y -= properties.rise;
       offset_y (iter, &ink_rect->y);
     }
 
@@ -7122,6 +7127,7 @@ pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter,
     {
       g_assert (logical_rect->width == iter->cluster_width);
       logical_rect->x += iter->cluster_x;
+      logical_rect->y -= properties.rise;
       offset_y (iter, &logical_rect->y);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]