Browse Source

Fixed Canvas#getContext(), caching the CanvasRenderingContext

v1.x
Tj Holowaychuk 14 years ago
parent
commit
8576bf9b76
  1. 2
      lib/canvas.js

2
lib/canvas.js

@ -84,7 +84,7 @@ Canvas.prototype.inspect = function(){
Canvas.prototype.getContext = function(contextId){
if ('2d' == contextId) {
var ctx = new Context2d(this);
var ctx = this._context2d || (this._context2d = new Context2d(this));
this.context = ctx;
ctx.canvas = this;
return ctx;

Loading…
Cancel
Save