summaryrefslogtreecommitdiff
path: root/source/fitz/draw-device.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-06-22 13:15:35 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-06-22 13:42:11 +0200
commitbdc0b4b959aed8a93e67f9a223a4e8de1930ac8f (patch)
tree8f7b3a71b44e83e9da8a0d5e1ccd7531200b768d /source/fitz/draw-device.c
parent12e17a2dbfe0c5a3bcc3210c692db1bc7547fee0 (diff)
downloadmupdf-bdc0b4b959aed8a93e67f9a223a4e8de1930ac8f.tar.xz
Transform device call scissor rectangles by device matrix.
Diffstat (limited to 'source/fitz/draw-device.c')
-rw-r--r--source/fitz/draw-device.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index 527d7e08..9a2cb507 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -562,7 +562,9 @@ fz_draw_clip_path(fz_context *ctx, fz_device *devp, const fz_path *path, int eve
if (scissor)
{
fz_irect bbox2;
- fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, scissor));
+ fz_rect tscissor = *scissor;
+ fz_transform_rect(&tscissor, &dev->transform);
+ fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor));
}
if (fz_is_empty_irect(&bbox) || fz_is_rect_gel(ctx, gel))
@@ -643,7 +645,9 @@ fz_draw_clip_stroke_path(fz_context *ctx, fz_device *devp, const fz_path *path,
if (scissor)
{
fz_irect bbox2;
- fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, scissor));
+ fz_rect tscissor = *scissor;
+ fz_transform_rect(&tscissor, &dev->transform);
+ fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor));
}
fz_try(ctx)
@@ -928,7 +932,9 @@ fz_draw_clip_text(fz_context *ctx, fz_device *devp, const fz_text *text, const f
if (scissor)
{
fz_irect bbox2;
- fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, scissor));
+ fz_rect tscissor = *scissor;
+ fz_transform_rect(&tscissor, &dev->transform);
+ fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor));
}
fz_try(ctx)
@@ -1051,7 +1057,9 @@ fz_draw_clip_stroke_text(fz_context *ctx, fz_device *devp, const fz_text *text,
if (scissor)
{
fz_irect bbox2;
- fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, scissor));
+ fz_rect tscissor = *scissor;
+ fz_transform_rect(&tscissor, &dev->transform);
+ fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor));
}
fz_try(ctx)
@@ -1610,7 +1618,9 @@ fz_draw_clip_image_mask(fz_context *ctx, fz_device *devp, fz_image *image, const
if (scissor)
{
fz_irect bbox2;
- fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, scissor));
+ fz_rect tscissor = *scissor;
+ fz_transform_rect(&tscissor, &dev->transform);
+ fz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, &tscissor));
}
fz_try(ctx)
@@ -1746,9 +1756,11 @@ fz_draw_begin_mask(fz_context *ctx, fz_device *devp, const fz_rect *rect, int lu
fz_irect bbox;
fz_draw_state *state = push_stack(ctx, dev);
fz_pixmap *shape = state->shape;
+ fz_rect trect = *rect;
STACK_PUSHED("mask");
- fz_intersect_irect(fz_irect_from_rect(&bbox, rect), &state->scissor);
+ fz_transform_rect(&trect, &dev->transform);
+ fz_intersect_irect(fz_irect_from_rect(&bbox, &trect), &state->scissor);
fz_try(ctx)
{
@@ -1878,13 +1890,15 @@ fz_draw_begin_group(fz_context *ctx, fz_device *devp, const fz_rect *rect, int i
fz_pixmap *dest;
fz_draw_state *state = &dev->stack[dev->top];
fz_colorspace *model = state->dest->colorspace;
+ fz_rect trect = *rect;
if (state->blendmode & FZ_BLEND_KNOCKOUT)
fz_knockout_begin(ctx, dev);
state = push_stack(ctx, dev);
STACK_PUSHED("group");
- fz_intersect_irect(fz_irect_from_rect(&bbox, rect), &state->scissor);
+ fz_transform_rect(&trect, &dev->transform);
+ fz_intersect_irect(fz_irect_from_rect(&bbox, &trect), &state->scissor);
fz_try(ctx)
{