Skip to content
This repository was archived by the owner on Jun 19, 2021. It is now read-only.

Commit ae4cb2c

Browse files
committed
More better random
1 parent 8acfd42 commit ae4cb2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/yatopiamc/bot/captcha/YatoCaptcha.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ private static InputStream generateImage(User u) {
3838
Graphics2D g = (Graphics2D) image.getGraphics();
3939
g.setFont(Font.createFont(Font.TRUETYPE_FONT, Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResourceAsStream("LoveBaby.ttf"))).deriveFont(40f));
4040
AffineTransform at = new AffineTransform();
41-
at.setToRotation(Math.random());
41+
at.setToRotation(ThreadLocalRandom.current().nextInt(0, 360));
4242
g.setTransform(at);
43-
g.drawString(code, 50, 50);
43+
g.drawString(code, ThreadLocalRandom.current().nextInt(25,75), ThreadLocalRandom.current().nextInt(25,75));
4444
g.dispose();
4545

4646
ByteArrayOutputStream os = new ByteArrayOutputStream();

0 commit comments

Comments
 (0)