Merge pull request #10162 from janpe2/svg-normalize-bbox

Normalize BBox of form XObjects in SVG back-end
This commit is contained in:
Tim van der Meij 2018-10-28 13:18:48 +01:00 committed by GitHub
commit ed4ac1bc67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -299,6 +299,11 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var dict = xobj.dict;
var matrix = dict.getArray('Matrix');
var bbox = dict.getArray('BBox');
if (Array.isArray(bbox) && bbox.length === 4) {
bbox = Util.normalizeRect(bbox);
} else {
bbox = null;
}
var group = dict.get('Group');
if (group) {
var groupOptions = {

View File

@ -1750,7 +1750,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.baseTransform = this.ctx.mozCurrentTransform;
if (Array.isArray(bbox) && bbox.length === 4) {
if (bbox) {
var width = bbox[2] - bbox[0];
var height = bbox[3] - bbox[1];
this.ctx.rect(bbox[0], bbox[1], width, height);

View File

@ -1278,7 +1278,7 @@ SVGGraphics = (function SVGGraphicsClosure() {
matrix[3], matrix[4], matrix[5]);
}
if (Array.isArray(bbox) && bbox.length === 4) {
if (bbox) {
var width = bbox[2] - bbox[0];
var height = bbox[3] - bbox[1];