Merge pull request #4008 from osmandapp/gpx_improvements

Add sync for point
This commit is contained in:
vshcherb 2017-07-01 15:55:27 +02:00 committed by GitHub
commit 38a347a836

View file

@ -316,9 +316,13 @@ public class TrackDetailsMenu {
if (highlights != null && highlights.length > 0) { if (highlights != null && highlights.length > 0) {
if (minimumVisibleXValue != 0 && maximumVisibleXValue != 0) { if (minimumVisibleXValue != 0 && maximumVisibleXValue != 0) {
if (highlights[0].getX() < minimumVisibleXValue) { if (highlights[0].getX() < minimumVisibleXValue) {
gpxItem.chartHighlightPos = minimumVisibleXValue; float difference = (maximumVisibleXValue - minimumVisibleXValue) * 0.1f;
gpxItem.chartHighlightPos = minimumVisibleXValue + difference;
chart.highlightValue(minimumVisibleXValue + difference, 0);
} else if (highlights[0].getX() > maximumVisibleXValue) { } else if (highlights[0].getX() > maximumVisibleXValue) {
gpxItem.chartHighlightPos = maximumVisibleXValue; float difference = (maximumVisibleXValue - minimumVisibleXValue) * 0.1f;
gpxItem.chartHighlightPos = maximumVisibleXValue - difference;
chart.highlightValue(maximumVisibleXValue - difference, 0);
} else { } else {
gpxItem.chartHighlightPos = highlights[0].getX(); gpxItem.chartHighlightPos = highlights[0].getX();
} }