diff options
author | James Bursa <james@netsurf-browser.org> | 2005-04-09 13:26:57 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-04-09 13:26:57 +0000 |
commit | 35770a2572784e65a22c303d475aab4e14ce4c09 (patch) | |
tree | 3629f6a948a9edea7fad61adc18d1f7e1b0b77f6 /gtk | |
parent | 49fdeafbbfc45792b27a6d9902c2b96998897130 (diff) | |
download | netsurf-35770a2572784e65a22c303d475aab4e14ce4c09.tar.gz netsurf-35770a2572784e65a22c303d475aab4e14ce4c09.tar.bz2 |
[project @ 2005-04-09 13:26:57 by bursa]
Fix nsfont_width() and nsfont_paint() when passed a 0-length string.
svn path=/import/netsurf/; revision=1615
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/font_pango.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/font_pango.c b/gtk/font_pango.c index 6d9c0d085..c07ed145b 100644 --- a/gtk/font_pango.c +++ b/gtk/font_pango.c @@ -48,8 +48,10 @@ bool nsfont_width(const struct css_style *style, PangoContext *context; PangoLayout *layout; - if (length == 0) - return 0; + if (length == 0) { + *width = 0; + return true; + } desc = nsfont_style_to_description(style); context = gdk_pango_context_get(); @@ -190,7 +192,7 @@ bool nsfont_paint(const struct css_style *style, ((c & 0xff0000) >> 8) | (c & 0xff0000 >> 16) }; if (length == 0) - return 0; + return true; desc = nsfont_style_to_description(style); context = gdk_pango_context_get(); |