[pango/line-height-attribute: 1/3] layout: Fix height tracking




commit 1c1730bbfcdd7a8b43d3bc40168921e2d11e63a1
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 6 21:56:08 2021 -0400

    layout: Fix height tracking
    
    When line-spacing is set, we need to use it for
    tracking the remaining height.

 pango/pango-layout.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 520782c5..cd455210 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3981,8 +3981,10 @@ add_line (PangoLayoutLine *line,
     {
       PangoRectangle logical_rect;
       pango_layout_line_get_extents (line, NULL, &logical_rect);
-      state->remaining_height -= logical_rect.height;
-      state->remaining_height -= layout->spacing;
+      if (layout->line_spacing == 0.0)
+        state->remaining_height -= logical_rect.height + layout->spacing;
+      else
+        state->remaining_height -= logical_rect.height * layout->line_spacing;
       state->line_height = logical_rect.height;
     }
 }


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