diff --git a/Tusker/Views/TrendHistoryView.swift b/Tusker/Views/TrendHistoryView.swift index 00a0c845..ffdb556a 100644 --- a/Tusker/Views/TrendHistoryView.swift +++ b/Tusker/Views/TrendHistoryView.swift @@ -97,7 +97,7 @@ class TrendHistoryView: UIView { borderLayer.path = path.cgPath.copy()! borderLayer.strokeColor = tintColor.cgColor borderLayer.fillColor = nil - borderLayer.lineWidth = 2 + borderLayer.lineWidth = lineWidth borderLayer.lineCap = .round path.addLine(to: CGPoint(x: bounds.width, y: bounds.height)) @@ -109,12 +109,16 @@ class TrendHistoryView: UIView { let fillColor = self.fillColor() fillLayer.strokeColor = fillColor fillLayer.fillColor = fillColor - fillLayer.lineWidth = 2 + fillLayer.lineWidth = lineWidth layer.addSublayer(fillLayer) layer.addSublayer(borderLayer) } + private var lineWidth: CGFloat { + (traitCollection.preferredContentSizeCategory > .large || UIAccessibility.isBoldTextEnabled) ? 4 : 2 + } + // The non-transparent fill color. // We blend with the view's background color ourselves so that final color is non-transparent, // otherwise when the fill layer's border and fill overlap, there's a visibly darker patch