mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Fix undefined group bounding box
This commit is contained in:
parent
1ce8afc23c
commit
4ae3802484
3 changed files with 15 additions and 4 deletions
|
@ -1507,10 +1507,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
group.bbox,
|
||||
currentCtx.mozCurrentTransform);
|
||||
// Clip the bounding box to the current canvas.
|
||||
bounds = Util.intersect(bounds, [0,
|
||||
0,
|
||||
currentCtx.canvas.width,
|
||||
currentCtx.canvas.height]);
|
||||
var canvasBounds = [0,
|
||||
0,
|
||||
currentCtx.canvas.width,
|
||||
currentCtx.canvas.height];
|
||||
bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];
|
||||
// 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue