mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Caches last parsed resource image, recornizes image repeats
This commit is contained in:
parent
2c23be369b
commit
f48f57e30a
3 changed files with 106 additions and 7 deletions
|
@ -1959,12 +1959,31 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
|
||||
paintImageXObject: function CanvasGraphics_paintImageXObject(objId) {
|
||||
var imgData = this.objs.get(objId);
|
||||
if (!imgData)
|
||||
if (!imgData) {
|
||||
error('Dependent image isn\'t ready yet');
|
||||
}
|
||||
|
||||
this.paintInlineImageXObject(imgData);
|
||||
},
|
||||
|
||||
paintImageMaskXObjectRepeat:
|
||||
function CanvasGraphics_paintImageMaskXObjectRepeat(objId, scaleX, scaleY,
|
||||
positions) {
|
||||
var imgData = this.objs.get(objId);
|
||||
if (!imgData) {
|
||||
error('Dependent image isn\'t ready yet');
|
||||
}
|
||||
|
||||
var width = imgData.width;
|
||||
var height = imgData.height;
|
||||
var map = [];
|
||||
for (var i = 0, ii = positions.length; i < ii; i += 2) {
|
||||
map.push({transform: [scaleX, 0, 0, scaleY, positions[i],
|
||||
positions[i + 1]], x: 0, y: 0, w: width, h: height});
|
||||
}
|
||||
this.paintInlineImageXObjectGroup(imgData, map);
|
||||
},
|
||||
|
||||
paintInlineImageXObject:
|
||||
function CanvasGraphics_paintInlineImageXObject(imgData) {
|
||||
var width = imgData.width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue