Merge pull request #618 from brendandahl/boundingbox

Fix bounding box for xobjects and patterns
This commit is contained in:
Artur Adib 2011-10-06 10:39:11 -07:00
commit ea20f91791
2 changed files with 11 additions and 6 deletions

8
pdf.js
View File

@ -5600,7 +5600,9 @@ var CanvasGraphics = (function canvasGraphics() {
var bbox = stream.dict.get('BBox');
if (bbox && isArray(bbox) && 4 == bbox.length) {
this.rectangle.apply(this, bbox);
var width = bbox[2] - bbox[0];
var height = bbox[3] - bbox[1];
this.rectangle(bbox[0], bbox[1], width, height);
this.clip();
this.endPath();
}
@ -6355,7 +6357,9 @@ var TilingPattern = (function tilingPattern() {
graphics.transform.apply(graphics, tmpTranslate);
if (bbox && isArray(bbox) && 4 == bbox.length) {
graphics.rectangle.apply(graphics, bbox);
var bboxWidth = bbox[2] - bbox[0];
var bboxHeight = bbox[3] - bbox[1];
graphics.rectangle(bbox[0], bbox[1], bboxWidth, bboxHeight);
graphics.clip();
graphics.endPath();
}

View File

@ -435,9 +435,9 @@ def checkEq(task, results, browser, masterMode):
# NB: this follows the format of Mozilla reftest
# output so that we can reuse its reftest-analyzer
# script
print >>eqLog, 'REFTEST TEST-UNEXPECTED-FAIL |', browser +'-'+ taskId +'-page'+ str(page + 1), '| image comparison (==)'
print >>eqLog, 'REFTEST IMAGE 1 (TEST):', snapshot
print >>eqLog, 'REFTEST IMAGE 2 (REFERENCE):', ref
eqLog.write('REFTEST TEST-UNEXPECTED-FAIL | ' + browser +'-'+ taskId +'-page'+ str(page + 1) + ' | image comparison (==)\n')
eqLog.write('REFTEST IMAGE 1 (TEST): ' + snapshot + '\n')
eqLog.write('REFTEST IMAGE 2 (REFERENCE): ' + ref + '\n')
passed = False
State.numEqFailures += 1
@ -456,7 +456,8 @@ def checkEq(task, results, browser, masterMode):
if passed:
print 'TEST-PASS | eq test', task['id'], '| in', browser
if State.eqLog:
State.eqLog.close();
def checkFBF(task, results, browser):
round0, round1 = results[0], results[1]