In cairo-path-bounds.c, _cairo_path_bounder_close_path() is an empty function, while it should consider the case when the prevoious command is a moveto, and then include the point in the calculated extent: static cairo_status_t _cairo_path_bounder_close_path (void *closure) { cairo_path_bounder_t *bounder = closure; if (bounder->has_initial_point) { _cairo_path_bounder_add_point (bounder, &bounder->current_point); bounder->has_initial_point = FALSE; } return CAIRO_STATUS_SUCCESS; } This comes from a Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=584623 I have tested the fix in Mozilla, which uses an old version of Cairo. By looking at the current code, the bug is still present, although the code has changed substantially. There may be other places in the code where a similar bug exists (don't know).
I believe that this bug was fixed in commit 89e1261dd0fdb6c6c0271f71dd84d72504969ab1 Author: Andrea Canciani <ranma42@gmail.com> Date: Fri Oct 22 12:35:40 2010 +0200 path-bounder: Simplify code If the path extents are tight, all the extents computations and approximations become trivial except for the stroke extents. Please reopen if it is still present in cairo master. NB: _cairo_path_bounder_close_path() is now an empty function, but _cairo_path_bounder_move_to() sets the extents.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.