Skip to content

Commit

Permalink
fix(linewidth): stackIndex not tested properly
Browse files Browse the repository at this point in the history
  • Loading branch information
jtenner committed Nov 4, 2019
1 parent 595e206 commit 0d1c52c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions __tests__/classes/CanvasRenderingContext2D.lineWidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ describe('lineWidth', () => {
ctx.save();
ctx.lineWidth = 10;
expect(ctx.lineWidth).toBe(10);
ctx.save();
expect(ctx.lineWidth).toBe(10);
ctx.restore();
expect(ctx.lineWidth).toBe(10);
ctx.restore();
expect(ctx.lineWidth).toBe(2);
});
Expand Down
2 changes: 1 addition & 1 deletion src/classes/CanvasRenderingContext2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ export default class CanvasRenderingContext2D {
this._lineDashStack.push(this._lineDashStack[this._stackIndex]);
this._lineDashOffsetStack.push(this._lineDashOffsetStack[this._stackIndex]);
this._lineJoinStack.push(this._lineJoinStack[this._stackIndex]);
this._lineWidthStack.push(this._lineWidthStack[this.stackIndex]);
this._lineWidthStack.push(this._lineWidthStack[this._stackIndex]);
this._miterLimitStack.push(this._miterLimitStack[this._stackIndex]);
this._shadowBlurStack.push(this._shadowBlurStack[this._stackIndex]);
this._shadowColorStack.push(this._shadowColorStack[this._stackIndex]);
Expand Down

0 comments on commit 0d1c52c

Please sign in to comment.