summaryrefslogtreecommitdiff
path: root/fitz/res_path.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-01 02:24:08 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-01 02:24:08 +0200
commit7c6ae0b110d0a29558305878482023ad7e8a66dc (patch)
treed405a91f844a96051d11db5d80c21cec27361aae /fitz/res_path.c
parent9c9674b3081bfd433460be934e2a792390474367 (diff)
downloadmupdf-7c6ae0b110d0a29558305878482023ad7e8a66dc.tar.xz
xps: Respect PathGeometry.Transform attribute.
Diffstat (limited to 'fitz/res_path.c')
-rw-r--r--fitz/res_path.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/fitz/res_path.c b/fitz/res_path.c
index ebfb3cdc..b4ac415a 100644
--- a/fitz/res_path.c
+++ b/fitz/res_path.c
@@ -171,6 +171,42 @@ fz_boundpath(fz_path *path, fz_strokestate *stroke, fz_matrix ctm)
}
void
+fz_transformpath(fz_path *path, fz_matrix ctm)
+{
+ fz_point p;
+ int k, i = 0;
+
+ while (i < path->len)
+ {
+ switch (path->els[i++].k)
+ {
+ case FZ_CURVETO:
+ for (k = 0; k < 3; k++)
+ {
+ p.x = path->els[i].v;
+ p.y = path->els[i+1].v;
+ p = fz_transformpoint(ctm, p);
+ path->els[i].v = p.x;
+ path->els[i+1].v = p.y;
+ i += 2;
+ }
+ break;
+ case FZ_MOVETO:
+ case FZ_LINETO:
+ p.x = path->els[i].v;
+ p.y = path->els[i+1].v;
+ p = fz_transformpoint(ctm, p);
+ path->els[i].v = p.x;
+ path->els[i+1].v = p.y;
+ i += 2;
+ break;
+ case FZ_CLOSEPATH:
+ break;
+ }
+ }
+}
+
+void
fz_debugpath(fz_path *path, int indent)
{
float x, y;