diff --git a/src/main/java/seng302/visualiser/controllers/RaceViewController.java b/src/main/java/seng302/visualiser/controllers/RaceViewController.java index c70d9798..ea778aa9 100644 --- a/src/main/java/seng302/visualiser/controllers/RaceViewController.java +++ b/src/main/java/seng302/visualiser/controllers/RaceViewController.java @@ -142,6 +142,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel private Timer blinkingTimer = new Timer(); private ImageView iconToDisplay; + private Double lastWindDirection; + public void initialize() { contentStackPane.setVisible(false); Image loadingImage = new Image("PP.png"); @@ -190,6 +192,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel chatHistory.decreaseOpacity(); } }); + + lastWindDirection = 0d; } public void showFinishDialog(ArrayList finishedBoats) { @@ -435,15 +439,14 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel * Updates the wind direction arrow and text as from info from the StreamParser * @param direction the from north angle of the wind. */ - private double preDir = 0; private void updateWindDirection(double direction) { windDirectionLabel.setText(String.format("%.1f°", direction)); RotateTransition rt = new RotateTransition(Duration.millis(300), windImageView); - rt.setByAngle(direction - preDir); - rt.setCycleCount(5); + rt.setByAngle(direction - lastWindDirection); + rt.setCycleCount(3); rt.setAutoReverse(true); rt.play(); - preDir = direction; + lastWindDirection = direction; // windImageView.setRotate(direction); } diff --git a/src/main/resources/images/wind-180.png b/src/main/resources/images/wind-180.png index 4bc6f05e..67891df8 100644 Binary files a/src/main/resources/images/wind-180.png and b/src/main/resources/images/wind-180.png differ