From c48f85621fec172d2a035e5e5626f264e7332a6a Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 5 Oct 2011 09:18:20 -0700 Subject: [PATCH] Fixing bounding boxes and test ref file writing. --- pdf.js | 6 ++++-- test/test.py | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pdf.js b/pdf.js index 1aa1f3e60..8cb1a062e 100644 --- a/pdf.js +++ b/pdf.js @@ -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,7 @@ var TilingPattern = (function tilingPattern() { graphics.transform.apply(graphics, tmpTranslate); if (bbox && isArray(bbox) && 4 == bbox.length) { - graphics.rectangle.apply(graphics, bbox); + graphics.rectangle(bbox[0], bbox[1], width, height); graphics.clip(); graphics.endPath(); } diff --git a/test/test.py b/test/test.py index 313a5e03a..1fb2e72c8 100644 --- a/test/test.py +++ b/test/test.py @@ -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]