mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #3082 from brendandahl/min-canvas-width
Use at least 1x1 pixel canvas for groups.
This commit is contained in:
commit
2a7f6d6582
1 changed files with 4 additions and 3 deletions
|
@ -1422,9 +1422,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
group.bbox,
|
||||
currentCtx.mozCurrentTransform);
|
||||
// Use ceil in case we're between sizes so we don't create canvas that is
|
||||
// too small.
|
||||
var drawnWidth = Math.ceil(bounds[2] - bounds[0]);
|
||||
var drawnHeight = Math.ceil(bounds[3] - bounds[1]);
|
||||
// too small and make the canvas at least 1x1 pixels.
|
||||
var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1);
|
||||
var drawnHeight = Math.max(Math.ceil(bounds[3] - bounds[1]), 1);
|
||||
|
||||
var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight);
|
||||
var groupCtx = scratchCanvas.getContext('2d');
|
||||
addContextCurrentTransform(groupCtx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue