diff options
Diffstat (limited to 'draw/draw_device.c')
-rw-r--r-- | draw/draw_device.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c index 2ee0de77..3df440ef 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -1653,6 +1653,23 @@ fz_new_draw_device(fz_context *ctx, fz_pixmap *dest) } fz_device * +fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, fz_bbox clip) +{ + fz_device *dev = fz_new_draw_device(ctx, dest); + fz_draw_device *ddev = dev->user; + + if (clip.x0 > ddev->stack[0].scissor.x0) + ddev->stack[0].scissor.x0 = clip.x0; + if (clip.x1 < ddev->stack[0].scissor.x1) + ddev->stack[0].scissor.x1 = clip.x1; + if (clip.y0 > ddev->stack[0].scissor.y0) + ddev->stack[0].scissor.y0 = clip.y0; + if (clip.y1 < ddev->stack[0].scissor.y1) + ddev->stack[0].scissor.y1 = clip.y1; + return dev; +} + +fz_device * fz_new_draw_device_type3(fz_context *ctx, fz_pixmap *dest) { fz_device *dev = fz_new_draw_device(ctx, dest); |