Skip to content

Commit f00c451

Browse files
committed
Draw temp targets at the BG level they target instead of in the override strip
1 parent 56f5b24 commit f00c451

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

LoopFollow/Charts/BGChartModel.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,11 +537,14 @@ final class BGChartModel: ObservableObject {
537537
}
538538
tempTargets = vc.tempTargetGraphData.map {
539539
let target = $0.correctionRange.first.map { String($0) } ?? ""
540+
// Temp targets render at the BG level they target (±5 mg/dL);
541+
// only overrides live in the top strip.
542+
let yCenter = Double($0.correctionRange.first ?? 0)
540543
return BandRect(
541544
start: Date(timeIntervalSince1970: $0.date),
542545
end: Date(timeIntervalSince1970: $0.endDate),
543-
yBottom: yBottom,
544-
yTop: yTop,
546+
yBottom: yCenter - 5,
547+
yTop: yCenter + 5,
545548
label: "Temp Target",
546549
pillText: "Temp Target\n\(Localizer.toDisplayUnits(target))\n\(pillTimeString(for: Date(timeIntervalSince1970: $0.date)))"
547550
)

0 commit comments

Comments
 (0)