From 35770a2572784e65a22c303d475aab4e14ce4c09 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 9 Apr 2005 13:26:57 +0000 Subject: [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 --- gtk/font_pango.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gtk') 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(); -- cgit v1.2.3