summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNis Martensen <nis.martensen@web.de>2009-06-16 23:27:20 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-17 16:45:48 +0100
commit158ab5cdede04de5071599a962ae9a354c223036 (patch)
treed583c3e5d8565e075708aa7b9dc45eb24ef78e15
parentf10bafdcddc5c422dab852ce4e74248189cf20f1 (diff)
[path] Fix missing implicit move-to
When cairo_curve_to happens to start a new subpath (e.g., after a call to cairo_new_sub_path()), it also needs to update the last_move_point. Otherwise the new current point after a close_path() will be at an unexpected position. Therefore, call _cairo_path_fixed_move_to() explicitly.
-rw-r--r--AUTHORS1
-rw-r--r--src/cairo-path-fixed.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 8c061743b..cda5a13ca 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -50,6 +50,7 @@ Tor Lillqvist <tml@novell.com> win32 build fixes, build scripts
Jinghua Luo <sunmoon1997@gmail.com> Add bitmap glyph transformation, many freetype and glitz fixes
Luke-Jr <luke-jr@utopios.org> Build fix for cross-compiling
Kjartan Maraas <kmaraas@gnome.org> Several fixes for sparse, lots of debug help for multi-thread bugs
+Nis Martensen <nis.martensen@web.de> Bug fix for sub paths
Jordi Mas <jordi@ximian.com> Bug fix for cairo_show_text
Nicholas Miell <nmiell@gmail.com> Fixes for linking bugs on AMD64
Eugeniy Meshcheryakov <eugen@debian.org> PS/PDF font subsetting improvements
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index a915adae9..2f9d47eaf 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -254,7 +254,7 @@ _cairo_path_fixed_line_to (cairo_path_fixed_t *path,
/* When there is not yet a current point, the line_to operation
* becomes a move_to instead. Note: We have to do this by
- * explicitly calling into _cairo_path_fixed_line_to to ensure
+ * explicitly calling into _cairo_path_fixed_move_to to ensure
* that the last_move_point state is updated properly.
*/
if (! path->has_current_point)
@@ -300,9 +300,9 @@ _cairo_path_fixed_curve_to (cairo_path_fixed_t *path,
point[1].x = x1; point[1].y = y1;
point[2].x = x2; point[2].y = y2;
+ /* make sure subpaths are started properly */
if (! path->has_current_point) {
- status = _cairo_path_fixed_add (path, CAIRO_PATH_OP_MOVE_TO,
- &point[0], 1);
+ status = _cairo_path_fixed_move_to (path, point[0].x, point[0].y);
if (status)
return status;
}