Skip to content

Commit e1c3886

Browse files
committed
Clarify minimum height on dated range
1 parent 5db1eb5 commit e1c3886

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WatchApp Extension/Scenes/GlucoseChartScene.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ struct Scaler {
6161
return CGPoint(x: CGFloat(x.timeIntervalSince(startDate)) * xScale, y: CGFloat(y - glucoseMin) * yScale)
6262
}
6363

64+
// By default enforce a minimum height so that the range is visible
6465
func rect(for range: WatchDatedRange, minHeight: CGFloat = 2) -> CGRect {
6566
let a = point(range.startDate, range.minValue)
6667
let b = point(range.endDate, range.maxValue)
67-
// Enforce a minimum height so that narrow target ranges still show up:
6868
let size = CGSize(width: b.x - a.x, height: max(b.y - a.y, minHeight))
6969
return CGRect(origin: CGPoint(x: a.x + size.width / 2, y: a.y + size.height / 2), size: size)
7070
}

0 commit comments

Comments
 (0)