From f00c45111505995936f4d54c19e296c50bc70a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bj=C3=B6rkert?= Date: Thu, 23 Jul 2026 13:14:25 +0200 Subject: [PATCH] Draw temp targets at the BG level they target instead of in the override strip --- LoopFollow/Charts/BGChartModel.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LoopFollow/Charts/BGChartModel.swift b/LoopFollow/Charts/BGChartModel.swift index 0d75d8150..a08bab90f 100644 --- a/LoopFollow/Charts/BGChartModel.swift +++ b/LoopFollow/Charts/BGChartModel.swift @@ -537,11 +537,14 @@ final class BGChartModel: ObservableObject { } tempTargets = vc.tempTargetGraphData.map { let target = $0.correctionRange.first.map { String($0) } ?? "" + // Temp targets render at the BG level they target (±5 mg/dL); + // only overrides live in the top strip. + let yCenter = Double($0.correctionRange.first ?? 0) return BandRect( start: Date(timeIntervalSince1970: $0.date), end: Date(timeIntervalSince1970: $0.endDate), - yBottom: yBottom, - yTop: yTop, + yBottom: yCenter - 5, + yTop: yCenter + 5, label: "Temp Target", pillText: "Temp Target\n\(Localizer.toDisplayUnits(target))\n\(pillTimeString(for: Date(timeIntervalSince1970: $0.date)))" )