mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-26 05:57:00 +03:00
[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
This commit is contained in:
parent
49fdeafbbf
commit
35770a2572
@ -48,8 +48,10 @@ bool nsfont_width(const struct css_style *style,
|
|||||||
PangoContext *context;
|
PangoContext *context;
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0) {
|
||||||
return 0;
|
*width = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
desc = nsfont_style_to_description(style);
|
desc = nsfont_style_to_description(style);
|
||||||
context = gdk_pango_context_get();
|
context = gdk_pango_context_get();
|
||||||
@ -190,7 +192,7 @@ bool nsfont_paint(const struct css_style *style,
|
|||||||
((c & 0xff0000) >> 8) | (c & 0xff0000 >> 16) };
|
((c & 0xff0000) >> 8) | (c & 0xff0000 >> 16) };
|
||||||
|
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
return 0;
|
return true;
|
||||||
|
|
||||||
desc = nsfont_style_to_description(style);
|
desc = nsfont_style_to_description(style);
|
||||||
context = gdk_pango_context_get();
|
context = gdk_pango_context_get();
|
||||||
|
Loading…
Reference in New Issue
Block a user