mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-20 04:35:32 +00:00
Merge branch 'bug4202' of ssh://sapsailing.com/home/trac/git into bug4202
This commit is contained in:
+2
-2
@@ -1226,7 +1226,7 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
private void updateBoatPositions(final Date newTime, final long transitionTimeInMillis,
|
||||
final Map<CompetitorDTO, Boolean> hasTailOverlapForCompetitor,
|
||||
final Iterable<CompetitorDTO> competitorsToShow, Map<CompetitorDTO, List<GPSFixDTOWithSpeedWindTackAndLegType>> boatData, boolean updateTailsOnly) {
|
||||
if (zoomingAnimationsInProgress == 0) {
|
||||
if (zoomingAnimationsInProgress == 0 || currentlyDragging) {
|
||||
fixesAndTails.updateFixes(boatData, hasTailOverlapForCompetitor, RaceMap.this, transitionTimeInMillis);
|
||||
showBoatsOnMap(newTime, transitionTimeInMillis,
|
||||
/* re-calculate; it could have changed since the asynchronous request was made: */
|
||||
@@ -1298,7 +1298,7 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
}
|
||||
|
||||
private void showCourseMarksOnMap(CoursePositionsDTO courseDTO, long transitionTimeInMillis) {
|
||||
if (zoomingAnimationsInProgress == 0) {
|
||||
if (zoomingAnimationsInProgress == 0 || currentlyDragging) {
|
||||
if (map != null && courseDTO != null) {
|
||||
WaypointDTO endWaypointForCurrentLegNumber = null;
|
||||
if (courseDTO.currentLegNumber > 0 && courseDTO.currentLegNumber <= courseDTO.totalLegsCount) {
|
||||
|
||||
+4
@@ -232,11 +232,15 @@ public abstract class CanvasOverlayV3 {
|
||||
|
||||
protected abstract void draw();
|
||||
|
||||
protected void onAttach() {
|
||||
}
|
||||
|
||||
protected OverlayViewOnAddHandler getOnAddHandler() {
|
||||
OverlayViewOnAddHandler result = new OverlayViewOnAddHandler() {
|
||||
@Override
|
||||
public void onAdd(OverlayViewMethods methods) {
|
||||
methods.getPanes().getMapPane().appendChild(canvas.getElement());
|
||||
CanvasOverlayV3.this.onAttach();
|
||||
}
|
||||
};
|
||||
return result;
|
||||
|
||||
+14
-1
@@ -70,6 +70,7 @@ public class WindStreamletsRaceboardOverlay extends MovingCanvasOverlay {
|
||||
private double latitudeSum;
|
||||
private ElementStyleMutationObserver observer;
|
||||
private boolean dragging = false;
|
||||
private boolean isAttached = false, startObserverWhenAttached = false;
|
||||
|
||||
public WindStreamletsRaceboardOverlay(MapWidget map, int zIndex, final Timer timer,
|
||||
RegattaAndRaceIdentifier raceIdentifier, SailingServiceAsync sailingService,
|
||||
@@ -298,6 +299,14 @@ public class WindStreamletsRaceboardOverlay extends MovingCanvasOverlay {
|
||||
return this.visible;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttach() {
|
||||
isAttached = true;
|
||||
if (startObserverWhenAttached) {
|
||||
Scheduler.get().scheduleDeferred(() -> addObserverIfNecessary());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean isVisible) {
|
||||
if (getCanvas() != null) {
|
||||
@@ -306,7 +315,11 @@ public class WindStreamletsRaceboardOverlay extends MovingCanvasOverlay {
|
||||
this.streamletLegend.setVisible(true);
|
||||
}
|
||||
this.startStreamlets();
|
||||
Scheduler.get().scheduleDeferred(() -> addObserverIfNecessary());
|
||||
if (isAttached) {
|
||||
Scheduler.get().scheduleDeferred(() -> addObserverIfNecessary());
|
||||
} else {
|
||||
startObserverWhenAttached = true;
|
||||
}
|
||||
this.visible = isVisible;
|
||||
} else {
|
||||
if (this.windField.getColors()) {
|
||||
|
||||
Reference in New Issue
Block a user