summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-11-11 20:13:17 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-11-11 20:23:47 -0500
commit6082a2eab8b8368cd167f8cc61c0df84d28a98ba (patch)
tree94b69a1e5fd78af4d63993dccbb39b55adfaaa28
parent7b688167a30fe9861bd896c8ab317483daf8286b (diff)
downloadpango-6082a2eab8b8368cd167f8cc61c0df84d28a98ba.tar.gz
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.
-rw-r--r--utils/viewer-render.c4
1 files 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);