summaryrefslogtreecommitdiff
path: root/fitzdraw
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-08-25 23:22:06 +0200
committerTor Andersson <tor@ghostscript.com>2009-08-25 23:22:06 +0200
commitb3149be5af9d7f377e71a9fa8805feb033e59447 (patch)
tree2897ca070cfe816b157fc5e2ba004a62a0ba3b8f /fitzdraw
parentb14e1e79a814a82ebd1705f482dfb56b4f40d4a0 (diff)
downloadmupdf-b3149be5af9d7f377e71a9fa8805feb033e59447.tar.xz
Add implicit closepath segments when filling non-closed subpaths.
Diffstat (limited to 'fitzdraw')
-rw-r--r--fitzdraw/pathfill.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fitzdraw/pathfill.c b/fitzdraw/pathfill.c
index e74fd879..75d30cc5 100644
--- a/fitzdraw/pathfill.c
+++ b/fitzdraw/pathfill.c
@@ -82,6 +82,14 @@ fz_fillpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness)
switch (path->els[i++].k)
{
case FZ_MOVETO:
+ /* implicit closepath before moveto */
+ if (i && (cx != bx || cy != by))
+ {
+ error = line(gel, &ctm, cx, cy, bx, by);
+ if (error)
+ return error;
+ }
+
x1 = path->els[i++].v;
y1 = path->els[i++].v;
cx = bx = x1;