summaryrefslogtreecommitdiff
path: root/tree/path.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-11-24 03:47:04 +0100
committerTor Andersson <tor@ghostscript.com>2004-11-24 03:47:04 +0100
commitb48de7618e25bc2cef9d9db4f9b49e1d546e438a (patch)
tree5f365a90a0bd355073e7d5d1f69e66d2f82b4446 /tree/path.c
parente092458f4403f1424d8fd1f5ec194880a05c3362 (diff)
downloadmupdf-b48de7618e25bc2cef9d9db4f9b49e1d546e438a.tar.xz
rewrite of render loop part 3
Diffstat (limited to 'tree/path.c')
-rw-r--r--tree/path.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/tree/path.c b/tree/path.c
index 74e29a59..ac070025 100644
--- a/tree/path.c
+++ b/tree/path.c
@@ -168,18 +168,10 @@ fz_endpath(fz_pathnode *path, fz_pathkind paint, fz_stroke *stroke, fz_dash *das
static inline fz_rect boundexpand(fz_rect r, fz_point p)
{
- if (r.min.x > r.max.x)
- {
- r.min.x = r.max.x = p.x;
- r.min.y = r.max.y = p.y;
- }
- else
- {
- if (p.x < r.min.x) r.min.x = p.x;
- if (p.y < r.min.y) r.min.y = p.y;
- if (p.x > r.max.x) r.max.x = p.x;
- if (p.y > r.max.y) r.max.y = p.y;
- }
+ if (p.x < r.min.x) r.min.x = p.x;
+ if (p.y < r.min.y) r.min.y = p.y;
+ if (p.x > r.max.x) r.max.x = p.x;
+ if (p.y > r.max.y) r.max.y = p.y;
return r;
}
@@ -187,9 +179,18 @@ fz_rect
fz_boundpathnode(fz_pathnode *path, fz_matrix ctm)
{
fz_point p;
- fz_rect r = fz_infiniterect();
+ fz_rect r = fz_emptyrect;
int i = 0;
+ if (path->len)
+ {
+ p.x = path->els[1].v;
+ p.y = path->els[2].v;
+ p = fz_transformpoint(ctm, p);
+ r.min.x = r.max.x = p.x;
+ r.min.y = r.max.y = p.y;
+ }
+
while (i < path->len)
{
switch (path->els[i++].k)