From 0c6b2f6f3bb2bc2fce5d1414e5925f0ff8387bae Mon Sep 17 00:00:00 2001 From: delvh Date: Sat, 11 Jul 2020 21:45:54 +0200 Subject: [PATCH] Tweaked random parameters a bit --- src/main/java/envoy/client/ui/controller/ChatScene.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/envoy/client/ui/controller/ChatScene.java b/src/main/java/envoy/client/ui/controller/ChatScene.java index 07d61d1..2f3402f 100644 --- a/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -360,7 +360,7 @@ public final class ChatScene implements Restorable { /** * Rotates every element in our application by 360° in at most 2.75s. - * + * * @since Envoy Client v0.1-beta */ @FXML @@ -370,9 +370,9 @@ public final class ChatScene implements Restorable { postButton, remainingChars, rotateButton, scene, settingsButton, userList, voiceButton }; final var random = new Random(); for (final var node : rotatableNodes) { - // Defines one whole rotation in at most 2.75s - final var rotateTransition = new RotateTransition(Duration.seconds(random.nextDouble() * 2.25 + 0.5), node); - rotateTransition.setByAngle(360); + // Defines at most four whole rotation in at most 4s + final var rotateTransition = new RotateTransition(Duration.seconds(random.nextDouble() * 3 + 1), node); + rotateTransition.setByAngle((random.nextInt(3) + 1) * 360); rotateTransition.play(); // This is needed as for some strange reason objects could stop before being // rotated back to 0°