Преглед изворни кода

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
         ForEach(glucoseData) { item in
             let glucoseToDisplay = units == .mgdL ? Decimal(item.glucose) : Decimal(item.glucose).asMmolL
             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 lowGlucose = units == .mgdL ? lowGlucose : lowGlucose.asMgdL
             let highGlucose = units == .mgdL ? highGlucose : highGlucose.asMgdL
             let highGlucose = units == .mgdL ? highGlucose : highGlucose.asMgdL
-            let targetGlucose = units == .mgdL ? currentGlucoseTarget : currentGlucoseTarget.asMgdL
 
 
             let pointMarkColor: Color = FreeAPS.getDynamicGlucoseColor(
             let pointMarkColor: Color = FreeAPS.getDynamicGlucoseColor(
                 glucoseValue: Decimal(item.glucose),
                 glucoseValue: Decimal(item.glucose),
                 highGlucoseColorValue: highGlucose,
                 highGlucoseColorValue: highGlucose,
                 lowGlucoseColorValue: lowGlucose,
                 lowGlucoseColorValue: lowGlucose,
-                targetGlucose: targetGlucose,
+                targetGlucose: currentGlucoseTarget,
                 glucoseColorScheme: glucoseColorScheme,
                 glucoseColorScheme: glucoseColorScheme,
                 offset: 20
                 offset: 20
             )
             )