mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-21 11:40:01 +00:00
bug 884: click on map background shall go back to live mode if the previous click was performed in live mode
This commit is contained in:
1 parent
2ba1dc3151
commit
28e82e90f7
1 file changed
+5
+5
@@ -271,12 +271,17 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
|
||||
RaceMap.this.raceMapImageManager.loadMapIcons(map);
|
||||
map.setSize("100%", "100%");
|
||||
map.addMapClickHandler(new MapClickHandler() {
|
||||
private PlayModes oldPlayMode = null;
|
||||
@Override
|
||||
public void onClick(MapClickEvent event) {
|
||||
if (event.getOverlay() == null) { // nothing hit; consider click on map the play/pause action
|
||||
if (timer.getPlayState() == PlayStates.Playing) {
|
||||
oldPlayMode = timer.getPlayMode();
|
||||
timer.pause();
|
||||
} else if (timer.getPlayState() == PlayStates.Paused || timer.getPlayState() == PlayStates.Stopped) {
|
||||
if (oldPlayMode != null) {
|
||||
timer.setPlayMode(oldPlayMode);
|
||||
}
|
||||
timer.play();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user