[pango/avoid-overlong-lines: 8/11] pango-view: Accept width 0




commit 1f725b392e7b15bac0f51a7593b565320ce1b1ab
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Nov 11 20:13:17 2021 -0500

    pango-view: Accept width 0
    
    GTK frequently uses this width during measuring,
    so it is good if we can reproduce what happens
    in this case.

 utils/viewer-render.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/utils/viewer-render.c b/utils/viewer-render.c
index ab0da2dd..d4b3f0f4 100644
--- a/utils/viewer-render.c
+++ b/utils/viewer-render.c
@@ -120,7 +120,7 @@ make_layout(PangoContext *context,
   if (size > 0)
     pango_font_description_set_size (font_description, size * PANGO_SCALE);
 
-  if (opt_width > 0)
+  if (opt_width >= 0)
     {
       if (opt_pango_units)
         pango_layout_set_width (layout, opt_width);
@@ -128,7 +128,7 @@ make_layout(PangoContext *context,
         pango_layout_set_width (layout, (opt_width * opt_dpi * PANGO_SCALE + 36) / 72);
     }
 
-  if (opt_height > 0)
+  if (opt_height >= 0)
     {
       if (opt_pango_units)
         pango_layout_set_width (layout, opt_height);


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