mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Normalize the BBox of form XObjects on the /core side
This commit is contained in:
parent
ecbdc508f7
commit
9cd5f94f03
3 changed files with 7 additions and 2 deletions
|
@ -299,6 +299,11 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||||
var dict = xobj.dict;
|
var dict = xobj.dict;
|
||||||
var matrix = dict.getArray('Matrix');
|
var matrix = dict.getArray('Matrix');
|
||||||
var bbox = dict.getArray('BBox');
|
var bbox = dict.getArray('BBox');
|
||||||
|
if (Array.isArray(bbox) && bbox.length === 4) {
|
||||||
|
bbox = Util.normalizeRect(bbox);
|
||||||
|
} else {
|
||||||
|
bbox = null;
|
||||||
|
}
|
||||||
var group = dict.get('Group');
|
var group = dict.get('Group');
|
||||||
if (group) {
|
if (group) {
|
||||||
var groupOptions = {
|
var groupOptions = {
|
||||||
|
|
|
@ -1750,7 +1750,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
||||||
|
|
||||||
this.baseTransform = this.ctx.mozCurrentTransform;
|
this.baseTransform = this.ctx.mozCurrentTransform;
|
||||||
|
|
||||||
if (Array.isArray(bbox) && bbox.length === 4) {
|
if (bbox) {
|
||||||
var width = bbox[2] - bbox[0];
|
var width = bbox[2] - bbox[0];
|
||||||
var height = bbox[3] - bbox[1];
|
var height = bbox[3] - bbox[1];
|
||||||
this.ctx.rect(bbox[0], bbox[1], width, height);
|
this.ctx.rect(bbox[0], bbox[1], width, height);
|
||||||
|
|
|
@ -1278,7 +1278,7 @@ SVGGraphics = (function SVGGraphicsClosure() {
|
||||||
matrix[3], matrix[4], matrix[5]);
|
matrix[3], matrix[4], matrix[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(bbox) && bbox.length === 4) {
|
if (bbox) {
|
||||||
var width = bbox[2] - bbox[0];
|
var width = bbox[2] - bbox[0];
|
||||||
var height = bbox[3] - bbox[1];
|
var height = bbox[3] - bbox[1];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue