diff options
Diffstat (limited to 'base/gspaint.c')
-rw-r--r-- | base/gspaint.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/base/gspaint.c b/base/gspaint.c index d67ef36bc..b3500c1d5 100644 --- a/base/gspaint.c +++ b/base/gspaint.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2022 Artifex Software, Inc. +/* Copyright (C) 2001-2023 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -208,6 +208,7 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, gs_fixed_rect bbox; gs_int_rect ibox; uint width, raster, band_space; + uint dev_width, dev_height; uint height, height2; gs_log2_scale_point log2_scale; gs_memory_t *mem; @@ -223,6 +224,7 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, if ((ibox.q.y <= ibox.p.y) || (ibox.q.x <= ibox.p.x)) return 2; width = (ibox.q.x - ibox.p.x) << log2_scale.x; + dev_width = ibox.q.x << log2_scale.x; raster = bitmap_raster(width); band_space = raster << log2_scale.y; height2 = (ibox.q.y - ibox.p.y); @@ -232,6 +234,7 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, if (height > height2) height = height2; height <<= log2_scale.y; + dev_height = ibox.q.y << log2_scale.y; mem = pgs->memory; mdev = gs_alloc_struct(mem, gx_device_memory, &st_device_memory, "alpha_buffer_init"); @@ -244,8 +247,8 @@ alpha_buffer_init(gs_gstate * pgs, fixed extra_x, fixed extra_y, int alpha_bits, } gs_make_mem_abuf_device(mdev, mem, dev, &log2_scale, alpha_bits, ibox.p.x << log2_scale.x, devn); - mdev->width = width; - mdev->height = height; + mdev->width = dev_width; + mdev->height = dev_height; mdev->bitmap_memory = mem; if ((*dev_proc(mdev, open_device)) ((gx_device *) mdev) < 0) { /* No room for bits, punt. */ |