Explorar el Código

Display scheduled basal dots
UI bug fix for issue nr 60: https://github.com/Artificial-Pancreas/iAPS/issues/60

(cherry picked from commit ffecddaba70b6c2ed7494f4189a3269e03275119)

Jon Mårtensson hace 3 años
padre
commit
551be37995
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

+ 3 - 2
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -667,8 +667,9 @@ extension MainChartView {
                 path.addLine(to: CGPoint(x: lastPoint.x, y: Config.basalHeight))
                 path.addLine(to: CGPoint(x: 0, y: Config.basalHeight))
             }
-
-            let endDateTime = dayAgoTime + min(max(screenHours, 2), 24).hours.timeInterval + min(max(screenHours, 2), 24).hours
+            let adjustForOptionalExtraHours = screenHours > 12 ? screenHours - 12 : 0
+            let endDateTime = dayAgoTime + min(max(screenHours - adjustForOptionalExtraHours, 12), 24).hours
+                .timeInterval + min(max(screenHours - adjustForOptionalExtraHours, 12), 24).hours
                 .timeInterval
             let autotunedBasalPoints = findRegularBasalPoints(
                 timeBegin: dayAgoTime,