Fix passing invalid points to CoreGraphics when building trend history graph
This commit is contained in:
parent
b842389449
commit
512e0e9053
|
@ -42,7 +42,10 @@ class TrendHistoryView: UIView {
|
||||||
|
|
||||||
private func createLayers() {
|
private func createLayers() {
|
||||||
guard let history = history,
|
guard let history = history,
|
||||||
history.count >= 2 else { return }
|
history.count >= 2,
|
||||||
|
!bounds.isEmpty else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let maxUses = history.max(by: { $0.uses < $1.uses })!.uses
|
let maxUses = history.max(by: { $0.uses < $1.uses })!.uses
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue