From 2dfa0c3cc361588649545df58616cf2bfe07592f Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Tue, 12 Apr 2016 12:07:19 +0100 Subject: [PATCH] PDF.js version 1.4.227 - See mozilla/pdf.js@127e6d73431346e43cd29a0814e0a65aebd230ff --- bower.json | 2 +- build/pdf.combined.js | 24 +++++++++++++++++------- build/pdf.js | 24 +++++++++++++++++------- build/pdf.worker.js | 4 ++-- package.json | 2 +- 5 files changed, 38 insertions(+), 18 deletions(-) diff --git a/bower.json b/bower.json index 2ddead4f7..0dfb15308 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.225", + "version": "1.4.227", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index d47d5150f..2723345bc 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.225'; -var pdfjsBuild = 'be6754a'; +var pdfjsVersion = '1.4.227'; +var pdfjsBuild = '127e6d7'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -29646,6 +29646,9 @@ var createMeshCanvas = (function createMeshCanvasClosure() { var EXPECTED_SCALE = 1.1; // MAX_PATTERN_SIZE is used to avoid OOM situation. var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough + // We need to keep transparent border around our pattern for fill(): + // createPattern with 'no-repeat' will bleed edges accross entire area. + var BORDER_SIZE = 2; var offsetX = Math.floor(bounds[0]); var offsetY = Math.floor(bounds[1]); @@ -29668,17 +29671,22 @@ var createMeshCanvas = (function createMeshCanvasClosure() { scaleY: 1 / scaleY }; + var paddedWidth = width + BORDER_SIZE * 2; + var paddedHeight = height + BORDER_SIZE * 2; + var canvas, tmpCanvas, i, ii; if (WebGLUtils.isEnabled) { canvas = WebGLUtils.drawFigures(width, height, backgroundColor, figures, context); // https://bugzilla.mozilla.org/show_bug.cgi?id=972126 - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - tmpCanvas.context.drawImage(canvas, 0, 0); + tmpCanvas = cachedCanvases.getCanvas('mesh', paddedWidth, paddedHeight, + false); + tmpCanvas.context.drawImage(canvas, BORDER_SIZE, BORDER_SIZE); canvas = tmpCanvas.canvas; } else { - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); + tmpCanvas = cachedCanvases.getCanvas('mesh', paddedWidth, paddedHeight, + false); var tmpCtx = tmpCanvas.context; var data = tmpCtx.createImageData(width, height); @@ -29694,11 +29702,13 @@ var createMeshCanvas = (function createMeshCanvasClosure() { for (i = 0; i < figures.length; i++) { drawFigure(data, figures[i], context); } - tmpCtx.putImageData(data, 0, 0); + tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); canvas = tmpCanvas.canvas; } - return {canvas: canvas, offsetX: offsetX, offsetY: offsetY, + return {canvas: canvas, + offsetX: offsetX - BORDER_SIZE * scaleX, + offsetY: offsetY - BORDER_SIZE * scaleY, scaleX: scaleX, scaleY: scaleY}; } return createMeshCanvas; diff --git a/build/pdf.js b/build/pdf.js index a565bb1ee..4a30c28e8 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.225'; -var pdfjsBuild = 'be6754a'; +var pdfjsVersion = '1.4.227'; +var pdfjsBuild = '127e6d7'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -5969,6 +5969,9 @@ var createMeshCanvas = (function createMeshCanvasClosure() { var EXPECTED_SCALE = 1.1; // MAX_PATTERN_SIZE is used to avoid OOM situation. var MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough + // We need to keep transparent border around our pattern for fill(): + // createPattern with 'no-repeat' will bleed edges accross entire area. + var BORDER_SIZE = 2; var offsetX = Math.floor(bounds[0]); var offsetY = Math.floor(bounds[1]); @@ -5991,17 +5994,22 @@ var createMeshCanvas = (function createMeshCanvasClosure() { scaleY: 1 / scaleY }; + var paddedWidth = width + BORDER_SIZE * 2; + var paddedHeight = height + BORDER_SIZE * 2; + var canvas, tmpCanvas, i, ii; if (WebGLUtils.isEnabled) { canvas = WebGLUtils.drawFigures(width, height, backgroundColor, figures, context); // https://bugzilla.mozilla.org/show_bug.cgi?id=972126 - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); - tmpCanvas.context.drawImage(canvas, 0, 0); + tmpCanvas = cachedCanvases.getCanvas('mesh', paddedWidth, paddedHeight, + false); + tmpCanvas.context.drawImage(canvas, BORDER_SIZE, BORDER_SIZE); canvas = tmpCanvas.canvas; } else { - tmpCanvas = cachedCanvases.getCanvas('mesh', width, height, false); + tmpCanvas = cachedCanvases.getCanvas('mesh', paddedWidth, paddedHeight, + false); var tmpCtx = tmpCanvas.context; var data = tmpCtx.createImageData(width, height); @@ -6017,11 +6025,13 @@ var createMeshCanvas = (function createMeshCanvasClosure() { for (i = 0; i < figures.length; i++) { drawFigure(data, figures[i], context); } - tmpCtx.putImageData(data, 0, 0); + tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); canvas = tmpCanvas.canvas; } - return {canvas: canvas, offsetX: offsetX, offsetY: offsetY, + return {canvas: canvas, + offsetX: offsetX - BORDER_SIZE * scaleX, + offsetY: offsetY - BORDER_SIZE * scaleY, scaleX: scaleX, scaleY: scaleY}; } return createMeshCanvas; diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 3231028c6..138e1e820 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.225'; -var pdfjsBuild = 'be6754a'; +var pdfjsVersion = '1.4.227'; +var pdfjsBuild = '127e6d7'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/package.json b/package.json index 083444874..06fce918e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.225", + "version": "1.4.227", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [