Skip to content

Commit

Permalink
Fix reading fillStyle after setting it from gradient to color
Browse files Browse the repository at this point in the history
  • Loading branch information
caldwell authored and zbjornson committed Dec 22, 2017
1 parent b8cf1d7 commit a84b2bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/context2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Context2d.prototype.__defineSetter__('fillStyle', function(val){
this.lastFillStyle = val;
this._setFillPattern(val);
} else if ('string' == typeof val) {
this.lastFillStyle = undefined;
this._setFillColor(val);
}
});
Expand Down
4 changes: 4 additions & 0 deletions test/public/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ tests['createLinearGradient()'] = function(ctx){

ctx.fillRect(10,10,130,130);
ctx.strokeRect(50,50,50,50);

ctx.fillStyle = '#13b575';
ctx.fillStyle = ctx.fillStyle;
ctx.fillRect(65,65,20,20);
};

tests['createRadialGradient()'] = function(ctx){
Expand Down

0 comments on commit a84b2bc

Please sign in to comment.