Intersect group bounding box with the current canvas dimensions.
This commit is contained in:
parent
99e45048cf
commit
29b89f1f1e
@ -1506,6 +1506,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
||||
var bounds = Util.getAxialAlignedBoundingBox(
|
||||
group.bbox,
|
||||
currentCtx.mozCurrentTransform);
|
||||
// Clip the bounding box to the current canvas.
|
||||
bounds = Util.intersect(bounds, [0,
|
||||
0,
|
||||
currentCtx.canvas.width,
|
||||
currentCtx.canvas.height]);
|
||||
// Use ceil in case we're between sizes so we don't create canvas that is
|
||||
// too small and make the canvas at least 1x1 pixels.
|
||||
var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1);
|
||||
|
BIN
test/pdfs/bigboundingbox.pdf
Normal file
BIN
test/pdfs/bigboundingbox.pdf
Normal file
Binary file not shown.
@ -1018,6 +1018,13 @@
|
||||
"link": true,
|
||||
"type": "load"
|
||||
},
|
||||
{ "id": "bigboundingbox",
|
||||
"file": "pdfs/bigboundingbox.pdf",
|
||||
"md5": "e5c5e2cb80826d6ebf535413865270cd",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"about": "When the bounding box for the xobject is transformed it creates a huge bounding box."
|
||||
},
|
||||
{ "id": "issue2386",
|
||||
"file": "pdfs/issue2386.pdf",
|
||||
"md5": "7dc787639aa6765214e9ff5494d231ed",
|
||||
|
Loading…
Reference in New Issue
Block a user