Merge branch 'master' into story_64_sails
# Conflicts: # racevisionGame/src/main/java/visualiser/gameController/Keys/ControlKey.java # racevisionGame/src/main/java/visualiser/gameController/Keys/SailsToggleKey.java # racevisionGame/src/main/java/visualiser/gameController/Keys/VMGKey.java # racevisionGame/src/main/java/visualiser/model/ResizableRaceCanvas.java
This commit is contained in:
@@ -416,8 +416,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
this.map.setWidth((int) getWidth());
|
||||
this.map.setHeight((int) getHeight());
|
||||
|
||||
redrawBoundaryImage();
|
||||
//Draw the race.
|
||||
drawRace();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -428,14 +429,14 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the race boundary, and saves the image to {@link #background}.
|
||||
* You should call {@link #clear()} before calling this.
|
||||
* Draws the race boundary.
|
||||
*/
|
||||
private void redrawBoundaryImage() {
|
||||
private void drawBoundary() {
|
||||
|
||||
//Prepare to draw.
|
||||
gc.setLineWidth(1);
|
||||
gc.setFill(Color.AQUA);
|
||||
gc.drawImage(new Image(getClass().getClassLoader().getResourceAsStream("images/WaterBackground.png")), 0, 0);
|
||||
|
||||
|
||||
//Calculate the screen coordinates of the boundary.
|
||||
List<GPSCoordinate> boundary = this.visualiserRace.getBoundary();
|
||||
@@ -454,8 +455,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
//Draw the boundary.
|
||||
gc.fillPolygon(xpoints, ypoints, xpoints.length);
|
||||
|
||||
//Render boundary to image.
|
||||
this.background = snapshot(null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -471,13 +470,8 @@ public class ResizableRaceCanvas extends ResizableCanvas {
|
||||
drawMarks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the race boundary image onto the canvas.
|
||||
* See {@link #background}.
|
||||
*/
|
||||
private void drawBoundary() {
|
||||
gc.drawImage(this.background, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Draws all track points for a given boat. Colour is set by boat, opacity
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Map;
|
||||
* Has a course, boats, boundaries, etc...
|
||||
* Observes LatestMessages and updates its state based on new messages.
|
||||
*/
|
||||
public class VisualiserRace extends Race {
|
||||
public class VisualiserRace extends Race implements Runnable {
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user