[cairo-commit] cairo/src cairo.c,1.52,1.53

Carl Worth commit at pdx.freedesktop.org
Sat Feb 12 13:01:41 PST 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv9654/src

Modified Files:
	cairo.c 
Log Message:

        * src/cairo.c (cairo_text_extents): Return all-zero extents if
        string is NULL.


Index: cairo.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- cairo.c	12 Feb 2005 20:59:53 -0000	1.52
+++ cairo.c	12 Feb 2005 21:01:39 -0000	1.53
@@ -1123,6 +1123,16 @@
     if (cr->status)
 	return;
 
+    if (utf8 == NULL) {
+	extents->x_bearing = 0.0;
+	extents->y_bearing = 0.0;
+	extents->width = 0.0;
+	extents->height = 0.0;
+	extents->x_advance = 0.0;
+	extents->y_advance = 0.0;
+	return;
+    }
+
     cr->status = _cairo_gstate_text_to_glyphs (cr->gstate, utf8, &glyphs, &nglyphs);
     CAIRO_CHECK_SANITY (cr);
 




More information about the cairo-commit mailing list