mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 06:49:56 +00:00
bug6098: when wind ladder image tile has been loaded, call redraw() and draw()
This commit is contained in:
1 parent
6f7b202a39
commit
d4cb909d23
3 files changed
+13
-6
No files matched your search
+2
-2
@@ -41,8 +41,8 @@ public class WindLadder extends DoubleCanvasBuffer<WindLadderOverlay> {
|
||||
super();
|
||||
this.coordinateSystem = coordinateSystem;
|
||||
this.buffer = new WindLadderOverlay[BUFFER_SIZE];
|
||||
this.buffer[0] = new WindLadderOverlay(this, map, zIndex, coordinateSystem);
|
||||
this.buffer[1] = new WindLadderOverlay(this, map, zIndex, coordinateSystem);
|
||||
this.buffer[0] = new WindLadderOverlay(this, map, zIndex, coordinateSystem, "buffer-0");
|
||||
this.buffer[1] = new WindLadderOverlay(this, map, zIndex, coordinateSystem, "buffer-1");
|
||||
this.apply(overlay -> overlay.setVisible(false));
|
||||
this.setVisible(true);
|
||||
this.addToMap();
|
||||
|
||||
+10
-3
@@ -24,7 +24,7 @@ public class WindLadderOverlay extends FullCanvasOverlay {
|
||||
|
||||
protected WindLadder windLadder;
|
||||
|
||||
protected ImageTileGenerator tileGen = new ImageTileGenerator(RESOURCES.windLadderTexture(), this::redraw);
|
||||
protected ImageTileGenerator tileGen = new ImageTileGenerator(RESOURCES.windLadderTexture(), ()->{ redraw(); draw(); });
|
||||
|
||||
protected Double windBearingRadians;
|
||||
protected Position fixPosition;
|
||||
@@ -36,12 +36,14 @@ public class WindLadderOverlay extends FullCanvasOverlay {
|
||||
|
||||
protected boolean redraw = true;
|
||||
protected int transitionDisableCountdown;
|
||||
private final String name;
|
||||
|
||||
public WindLadderOverlay(WindLadder windLadder, MapWidget map, int zIndex, CoordinateSystem coordinateSystem) {
|
||||
public WindLadderOverlay(WindLadder windLadder, MapWidget map, int zIndex, CoordinateSystem coordinateSystem, String name) {
|
||||
super(map, zIndex, coordinateSystem);
|
||||
this.map.addZoomChangeHandler(event -> this.onZoomChange());
|
||||
this.windLadder = windLadder;
|
||||
getCanvas().getElement().setId("wind-ladder-display");
|
||||
getCanvas().getElement().setId("wind-ladder-display-"+name);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean update(Double windBearingRadians, Position fixPosition, long timeForPositionTransitionMillis) {
|
||||
@@ -259,4 +261,9 @@ public class WindLadderOverlay extends FullCanvasOverlay {
|
||||
}
|
||||
return mapHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString()+" "+name;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -66,7 +66,7 @@ public abstract class FullCanvasOverlay extends CanvasOverlayV3 implements Requi
|
||||
mapProjectionSet = true;
|
||||
setCanvasSettings();
|
||||
super.getOnDrawHandler().onDraw(methods);
|
||||
return false;
|
||||
return false; // don't repeat
|
||||
}, /* delay */ 1000);
|
||||
} else {
|
||||
super.getOnDrawHandler().onDraw(methods);
|
||||
|
||||
Reference in new issue
Block a user