summaryrefslogtreecommitdiff
path: root/gs/src/zshade.c
diff options
context:
space:
mode:
authorAlex Cherepanov <alex.cherepanov@artifex.com>2006-10-25 12:10:09 +0000
committerAlex Cherepanov <alex.cherepanov@artifex.com>2006-10-25 12:10:09 +0000
commit00feda6e724f58cd80e542ef348e283dc9e0d891 (patch)
treed3161937c8f46a23a72930eb6c576e1aeeee920d /gs/src/zshade.c
parent7d3054b1110c72e57ca8fb7abd167128a5ed0e55 (diff)
downloadghostpdl-00feda6e724f58cd80e542ef348e283dc9e0d891.tar.gz
Normalize bounding box retrieved from PostScript BBox parameter in the
shading dictionary because Adobe interpreters accept denormalized box. Bug 688937, customer 200. DIFFERENCES: None git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@7121 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zshade.c')
-rw-r--r--gs/src/zshade.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gs/src/zshade.c b/gs/src/zshade.c
index 7c6151320..bf1d16415 100644
--- a/gs/src/zshade.c
+++ b/gs/src/zshade.c
@@ -195,10 +195,21 @@ build_shading(i_ctx_t *i_ctx_p, build_shading_proc_t proc)
params.have_BBox = false;
else if ((code = dict_floats_param(imemory, op, "BBox",
4, box, NULL)) == 4) {
- params.BBox.p.x = box[0];
- params.BBox.p.y = box[1];
- params.BBox.q.x = box[2];
- params.BBox.q.y = box[3];
+ /* Adobe Interpreters accept denormalised BBox - bug 688937 */
+ if (box[0] <= box[2]) {
+ params.BBox.p.x = box[0];
+ params.BBox.q.x = box[2];
+ } else {
+ params.BBox.p.x = box[2];
+ params.BBox.q.x = box[0];
+ }
+ if (box[1] <= box[3]) {
+ params.BBox.p.y = box[1];
+ params.BBox.q.y = box[3];
+ } else {
+ params.BBox.p.y = box[3];
+ params.BBox.q.y = box[1];
+ }
params.have_BBox = true;
} else
goto fail;