diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-05-19 23:10:19 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-05-19 23:10:19 +0200 |
commit | 3a126dce6694279b4987e357090bad0d8f409c03 (patch) | |
tree | bf10db9fdd5fdf9241a7e9a22701e336550ba2c1 /fitz/dev_draw.c | |
parent | 4bba0267888beeb11d777e378b6db589b20cc53c (diff) | |
download | mupdf-3a126dce6694279b4987e357090bad0d8f409c03.tar.xz |
Clip the bounding box returned from the global edge list against the scissor, since the global edge list only clips lines against the top and bottom edges.
Diffstat (limited to 'fitz/dev_draw.c')
-rw-r--r-- | fitz/dev_draw.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fitz/dev_draw.c b/fitz/dev_draw.c index d8cb575c..cc7bdc0c 100644 --- a/fitz/dev_draw.c +++ b/fitz/dev_draw.c @@ -119,6 +119,8 @@ fz_drawfillpath(void *user, fz_path *path, int evenodd, fz_matrix ctm, fz_sortgel(dev->gel); bbox = fz_boundgel(dev->gel); + bbox = fz_intersectbbox(bbox, dev->scissor); + if (fz_isemptyrect(bbox)) return; @@ -160,6 +162,8 @@ fz_drawstrokepath(void *user, fz_path *path, fz_strokestate *stroke, fz_matrix c fz_sortgel(dev->gel); bbox = fz_boundgel(dev->gel); + bbox = fz_intersectbbox(bbox, dev->scissor); + if (fz_isemptyrect(bbox)) return; @@ -200,6 +204,7 @@ fz_drawclippath(void *user, fz_path *path, int evenodd, fz_matrix ctm) fz_sortgel(dev->gel); bbox = fz_boundgel(dev->gel); + bbox = fz_intersectbbox(bbox, dev->scissor); if (fz_isemptyrect(bbox) || fz_isrectgel(dev->gel)) { @@ -254,6 +259,8 @@ fz_drawclipstrokepath(void *user, fz_path *path, fz_strokestate *stroke, fz_matr fz_sortgel(dev->gel); bbox = fz_boundgel(dev->gel); + bbox = fz_intersectbbox(bbox, dev->scissor); + mask = fz_newpixmapwithrect(nil, bbox); dest = fz_newpixmapwithrect(dev->model, bbox); @@ -469,8 +476,8 @@ fz_drawfillshade(void *user, fz_shade *shade, fz_matrix ctm) bounds = fz_transformrect(fz_concat(shade->matrix, ctm), shade->bbox); bbox = fz_roundrect(bounds); - bbox = fz_intersectbbox(bbox, dev->scissor); + if (fz_isemptyrect(bbox)) return; |