Browse Source

Fixed js-land instanceof

causes issues with several Canvas modules
v1.x
Tj Holowaychuk 13 years ago
parent
commit
a0e45d449f
  1. 6
      lib/context2d.js

6
lib/context2d.js

@ -150,7 +150,7 @@ Context2d.prototype.setTransform = function(){
*/
Context2d.prototype.__defineSetter__('fillStyle', function(val){
if (val instanceof CanvasGradient) {
if ('CanvasGradient' == val.constructor.name) {
this.lastFillStyle = val;
this._setFillPattern(val);
} else if ('string' == typeof val) {
@ -176,7 +176,7 @@ Context2d.prototype.__defineGetter__('fillStyle', function(){
*/
Context2d.prototype.__defineSetter__('strokeStyle', function(val){
if (val instanceof CanvasGradient) {
if ('CanvasGradient' == val.constructor.name) {
this.lastStrokeStyle = val;
this._setStrokePattern(val);
} else if ('string' == typeof val) {
@ -315,7 +315,7 @@ Context2d.prototype.getImageData = function(x, y, width, height){
*/
Context2d.prototype.createImageData = function(width, height){
if (width instanceof ImageData) {
if ('ImageData' == width.constructor.name) {
height = width.height;
width = width.width;
}

Loading…
Cancel
Save