Added a light variant of the arrow image.

nightMode.css loads this instead of the regular dark arrow.
ResizableRaceCanvas doesn't cache the race boundary background, as it was unneccessary and stopped the canvas from being transparent.
#story[1093]
main
fjc40 8 years ago
parent e1905e9e36
commit e4999a3c93

@ -12,7 +12,6 @@ import shared.model.GPSCoordinate;
import shared.model.Mark; import shared.model.Mark;
import shared.model.RaceClock; import shared.model.RaceClock;
import java.time.Duration;
import java.util.List; import java.util.List;
/** /**
@ -39,12 +38,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
*/ */
private VisualiserRace visualiserRace; private VisualiserRace visualiserRace;
/**
* The background of the race.
* We render the background whenever the race boundary changes, or the screen size changes.
*/
private Image background;
private boolean annoName = true; private boolean annoName = true;
private boolean annoAbbrev = true; private boolean annoAbbrev = true;
@ -407,13 +400,9 @@ public class ResizableRaceCanvas extends ResizableCanvas {
this.map.setWidth((int) getWidth()); this.map.setWidth((int) getWidth());
this.map.setHeight((int) getHeight()); this.map.setHeight((int) getHeight());
//Redraw the boundary.
redrawBoundaryImage();
//Draw the race. //Draw the race.
drawRace(); drawRace();
} }
@ -426,15 +415,13 @@ public class ResizableRaceCanvas extends ResizableCanvas {
/** /**
* Draws the race boundary, and saves the image to {@link #background}. * Draws the race boundary.
* You should call {@link #clear()} before calling this.
*/ */
private void redrawBoundaryImage() { private void drawBoundary() {
//Prepare to draw. //Prepare to draw.
gc.setLineWidth(1); gc.setLineWidth(1);
gc.setFill(Color.AQUA); gc.setFill(Color.AQUA);
gc.drawImage(new Image(getClass().getClassLoader().getResourceAsStream("images/WaterBackground.png")), 0, 0);
//Calculate the screen coordinates of the boundary. //Calculate the screen coordinates of the boundary.
@ -454,9 +441,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
//Draw the boundary. //Draw the boundary.
gc.fillPolygon(xpoints, ypoints, xpoints.length); gc.fillPolygon(xpoints, ypoints, xpoints.length);
//Render boundary to image.
this.background = snapshot(null, null);
} }
/** /**
@ -481,15 +465,6 @@ public class ResizableRaceCanvas extends ResizableCanvas {
} }
/**
* Draws the race boundary image onto the canvas.
* See {@link #background}.
*/
private void drawBoundary() {
gc.drawImage(this.background, 0, 0);
}

@ -50,4 +50,6 @@
.scroll-bar > .increment-button:pressed > .increment-arrow, .scroll-bar > .increment-button:pressed > .increment-arrow,
.scroll-bar > .decrement-button:pressed > .decrement-arrow { .scroll-bar > .decrement-button:pressed > .decrement-arrow {
-fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255); -fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255);
} }

@ -51,4 +51,9 @@
.scroll-bar > .increment-button:pressed > .increment-arrow, .scroll-bar > .increment-button:pressed > .increment-arrow,
.scroll-bar > .decrement-button:pressed > .decrement-arrow { .scroll-bar > .decrement-button:pressed > .decrement-arrow {
-fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255); -fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255);
} }
#arrowImage {
-fx-image: url("/visualiser/images/arrowLight.png");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Loading…
Cancel
Save