Created
April 7, 2012 13:23
-
-
Save florian/2328855 to your computer and use it in GitHub Desktop.
A small script that makes it possible to chain the HTML5 canvas methods. Pretty much a smaller version of chainvas: http://leaverou.github.com/chainvas/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var c = window.CanvasRenderingContext2D.prototype, | |
wrapFn = function (method) { | |
return function () { | |
var ret = method.apply(this, arguments); | |
return ret === undefined ? this : method; | |
}; | |
}; | |
for (var i in c) { | |
c[i] = wrapFn(c[i]); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment