소스 검색

Fix color bug when using dynamic bg color

polscm32 1 년 전
부모
커밋
a6a1b08e09
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      FreeAPS/Sources/Modules/Home/View/Chart/GlucoseChartView.swift

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

@@ -19,16 +19,15 @@ struct GlucoseChartView: ChartContent {
         ForEach(glucoseData) { item in
             let glucoseToDisplay = units == .mgdL ? Decimal(item.glucose) : Decimal(item.glucose).asMmolL
 
-            // low glucose, high glucose and target is parsed in state to mmol/L; parse it back to mg/dl here for comparison
+            // low glucose and high glucose is parsed in state to mmol/L; parse it back to mg/dL here for comparison
             let lowGlucose = units == .mgdL ? lowGlucose : lowGlucose.asMgdL
             let highGlucose = units == .mgdL ? highGlucose : highGlucose.asMgdL
-            let targetGlucose = units == .mgdL ? currentGlucoseTarget : currentGlucoseTarget.asMgdL
 
             let pointMarkColor: Color = FreeAPS.getDynamicGlucoseColor(
                 glucoseValue: Decimal(item.glucose),
                 highGlucoseColorValue: highGlucose,
                 lowGlucoseColorValue: lowGlucose,
-                targetGlucose: targetGlucose,
+                targetGlucose: currentGlucoseTarget,
                 glucoseColorScheme: glucoseColorScheme,
                 offset: 20
             )