Skip to content

Commit

Permalink
Update captcha.ts
Browse files Browse the repository at this point in the history
Bug solved as per reported in issue #47
  • Loading branch information
Shashank3736 authored Jan 2, 2023
1 parent b8d3f63 commit 36367da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ts-script/captcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class Captcha {
this._ctx.translate(coordinates[n][0], coordinates[n][1]);
if (option.skew) {this._ctx.transform(1, Math.random(), getRandom(20) / 100, 1, 0, 0);}
if (option.rotate && option.rotate > 0) {this._ctx.rotate(getRandom(-option.rotate, option.rotate) * Math.PI / 180);}
if (option.colors && option.colors?.length > 2) {this._ctx.fillStyle = option.colors[getRandom(option.colors.length - 1)];}
if (option.colors && option.colors?.length >= 2) {this._ctx.fillStyle = option.colors[getRandom(option.colors.length - 1)];}
this._ctx.fillText(option.text[n], 0, 0);
this._ctx.restore();
}
Expand Down

0 comments on commit 36367da

Please sign in to comment.