Browse Source

Check for both CanvasGradient and CanvasPattern in ctx.strokeStyle and ctx.fillStyle.

v1.x
Robert Sköld 13 years ago
parent
commit
17080848ba
  1. 4
      lib/context2d.js

4
lib/context2d.js

@ -165,7 +165,7 @@ Context2d.prototype.setTransform = function(){
*/
Context2d.prototype.__defineSetter__('fillStyle', function(val){
if ('CanvasGradient' == val.constructor.name) {
if (~['CanvasGradient','CanvasPattern'].indexOf(val.constructor.name)) {
this.lastFillStyle = val;
this._setFillPattern(val);
} else if ('string' == typeof val) {
@ -191,7 +191,7 @@ Context2d.prototype.__defineGetter__('fillStyle', function(){
*/
Context2d.prototype.__defineSetter__('strokeStyle', function(val){
if ('CanvasGradient' == val.constructor.name) {
if (~['CanvasGradient','CanvasPattern'].indexOf(val.constructor.name)) {
this.lastStrokeStyle = val;
this._setStrokePattern(val);
} else if ('string' == typeof val) {

Loading…
Cancel
Save