data-canvas
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "data-canvas", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Improved event handling and testing for the HTML5 canvas", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -117,3 +117,4 @@ /** | ||
ctx.drawImage.apply(ctx, arguments); | ||
this.calls = this.calls.concat(transformedCalls(recorder.calls, arguments)); | ||
calls = calls.concat(transformedCalls(recorder.calls, arguments)); | ||
this.calls = calls; | ||
} | ||
@@ -120,0 +121,0 @@ } |
@@ -447,2 +447,19 @@ (function() { | ||
}); | ||
// Regression test for #13 | ||
it('should record calls after drawImage', function() { | ||
var image = makeOffscreenImage(); | ||
var dtx = dataCanvas.getDataContext(canvas); | ||
dtx.clearRect(0, 0, 200, 50); | ||
dtx.drawImage(image, 0, 0); | ||
dtx.fillRect(20, 10, 100, 40); | ||
expect(dtx.calls).to.have.length(5); | ||
expect(dtx.drawnObjects()).to.deep.equal(['A']); | ||
expect(dtx.callsOf('clearRect')).to.deep.equal([['clearRect', 0, 0, 200, 50]]); | ||
expect(dtx.callsOf('fillRect')).to.deep.equal([ | ||
['fillRect', 0, 0, 50, 50], | ||
['fillRect', 20, 10, 100, 40] | ||
]); | ||
}); | ||
}); | ||
@@ -449,0 +466,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59931
814