Merge pull request #9370 from osmandapp/analyze_fixes

Analyze scroll fixes
This commit is contained in:
vshcherb 2020-07-03 23:24:34 +02:00 committed by GitHub
commit 5dc28cb530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,11 @@ public class TrackDetailsMenu {
if (point != null) {
int index = segment.points.indexOf(point);
gpxItem.locationOnMap = GPXLayer.createProjectionPoint(segment.points.get(index - 1), point, tb.getLatLonFromPixel(mx, my));
gpxItem.chartHighlightPos = (float) (gpxItem.locationOnMap.distance / ((OrderedLineDataSet) ds.get(0)).getDivX());
float pos = (float) (gpxItem.locationOnMap.distance / ((OrderedLineDataSet) ds.get(0)).getDivX());
float nextVisibleX = chart.getLowestVisibleX() + (pos - gpxItem.chartHighlightPos);
gpxItem.chartHighlightPos = pos;
chart.moveViewToX(nextVisibleX);
chart.highlightValue(gpxItem.chartHighlightPos, 0);
}
myLocation = location;
@ -609,7 +613,7 @@ public class TrackDetailsMenu {
lastPerformedGesture == ChartGesture.ROTATE) {
gpxItem.chartMatrix = new Matrix(chart.getViewPortHandler().getMatrixTouch());
refreshChart(chart, true);
refreshChart(chart, false);
}
}
}