Bugfix: Elevation in charts smoothing removed as it was broken.

Fixes #1241.
This commit is contained in:
Dennis Guse
2022-06-11 14:24:41 +02:00
parent d68008941e
commit 0b326a77c2
6 changed files with 22 additions and 26 deletions
@@ -29,15 +29,15 @@ public class ChartPoint {
this.altitude = altitude;
}
public ChartPoint(@NonNull TrackStatistics trackStatistics, @NonNull TrackPoint trackPoint, Speed smoothedSpeed, Altitude smoothedAltitude, boolean chartByDistance, UnitSystem unitSystem) {
public ChartPoint(@NonNull TrackStatistics trackStatistics, @NonNull TrackPoint trackPoint, Speed smoothedSpeed, boolean chartByDistance, UnitSystem unitSystem) {
if (chartByDistance) {
timeOrDistance = trackStatistics.getTotalDistance().toKM_Miles(unitSystem);
} else {
timeOrDistance = trackStatistics.getTotalTime().toMillis();
}
if (smoothedAltitude != null) {
altitude = Distance.of(smoothedAltitude.toM()).toM_FT(unitSystem);
if (trackPoint.hasAltitude()) {
altitude = Distance.of(trackPoint.getAltitude().toM()).toM_FT(unitSystem);
}
if (smoothedSpeed != null) {