Skip to content

Commit

Permalink
Fix positioning of M and X in RTDX passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Feb 23, 2024
1 parent ed8f4f9 commit b104699
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/routes/(rtdx)/PasswordImage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@
ctx.drawImage(symbol, x, y, 53, 53);
const character = await loadImage(char.charAt(0));
ctx.drawImage(character, x + 13, y + 14, 25, 25);
let extraXOffset = 0;
switch (char.charAt(0)) {
case 'm':
extraXOffset = 0.9;
break;
case 'x':
extraXOffset = 0.4;
break;
}
ctx.drawImage(character, x + 13 + extraXOffset, y + 14, 25, 25);
};
const characters = password.toLowerCase().match(/.{1,2}/g)!;
Expand Down

0 comments on commit b104699

Please sign in to comment.