mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 03:38:06 +02:00
Return all-zero extents if string is NULL.
This commit is contained in:
parent
b33f37ff04
commit
f3f63f3924
2 changed files with 15 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2005-02-12 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo.c (cairo_text_extents): Return all-zero extents if
|
||||
string is NULL.
|
||||
|
||||
2005-02-12 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* src/cairo_gstate.c
|
||||
|
|
|
|||
10
src/cairo.c
10
src/cairo.c
|
|
@ -1123,6 +1123,16 @@ cairo_text_extents (cairo_t *cr,
|
|||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue