mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Use at least 1x1 pixel canvas for groups.
This commit is contained in:
parent
985307907b
commit
ecb04c8bbe
1 changed files with 4 additions and 3 deletions
|
@ -1422,9 +1422,10 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
||||||
group.bbox,
|
group.bbox,
|
||||||
currentCtx.mozCurrentTransform);
|
currentCtx.mozCurrentTransform);
|
||||||
// Use ceil in case we're between sizes so we don't create canvas that is
|
// Use ceil in case we're between sizes so we don't create canvas that is
|
||||||
// too small.
|
// too small and make the canvas at least 1x1 pixels.
|
||||||
var drawnWidth = Math.ceil(bounds[2] - bounds[0]);
|
var drawnWidth = Math.max(Math.ceil(bounds[2] - bounds[0]), 1);
|
||||||
var drawnHeight = Math.ceil(bounds[3] - bounds[1]);
|
var drawnHeight = Math.max(Math.ceil(bounds[3] - bounds[1]), 1);
|
||||||
|
|
||||||
var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight);
|
var scratchCanvas = createScratchCanvas(drawnWidth, drawnHeight);
|
||||||
var groupCtx = scratchCanvas.getContext('2d');
|
var groupCtx = scratchCanvas.getContext('2d');
|
||||||
addContextCurrentTransform(groupCtx);
|
addContextCurrentTransform(groupCtx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue