Merge pull request #9531 from osmandapp/analyze_screen_fixes
Analyze screen follow current point fixes
This commit is contained in:
commit
74346609a8
1 changed files with 7 additions and 1 deletions
|
@ -148,7 +148,13 @@ public class TrackDetailsMenu {
|
|||
LatLon latLon = tb.getLatLonFromPixel(mx, my);
|
||||
gpxItem.locationOnMap = GPXLayer.createProjectionPoint(points.first, points.second, latLon);
|
||||
float pos = (float) (gpxItem.locationOnMap.distance / ((OrderedLineDataSet) ds.get(0)).getDivX());
|
||||
float nextVisibleX = chart.getLowestVisibleX() + (pos - gpxItem.chartHighlightPos);
|
||||
float lowestVisibleX = chart.getLowestVisibleX();
|
||||
float highestVisibleX = chart.getHighestVisibleX();
|
||||
float nextVisibleX = lowestVisibleX + (pos - gpxItem.chartHighlightPos);
|
||||
float oneFourthDiff = (highestVisibleX - lowestVisibleX) / 4f;
|
||||
if (pos > oneFourthDiff) {
|
||||
nextVisibleX = pos - oneFourthDiff;
|
||||
}
|
||||
gpxItem.chartHighlightPos = pos;
|
||||
|
||||
chart.moveViewToX(nextVisibleX);
|
||||
|
|
Loading…
Reference in a new issue