added static var

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-09-20 13:44:19 -05:00
parent 6fc8c0cf49
commit 0fc6d78d3c

View File

@ -45,7 +45,7 @@ open class Line: View {
// MARK: - Configuration
//--------------------------------------------------
/// Width of the line.
public let lineWidth: CGFloat = 1.0
public static let lineWidth: CGFloat = 1.0
//--------------------------------------------------
// MARK: - Public Properties
@ -59,9 +59,9 @@ open class Line: View {
/// The natural size for the receiving view, considering only properties of the view itself.
open override var intrinsicContentSize: CGSize {
if orientation == .vertical {
return .init(width: 1, height: bounds.height)
return .init(width: Self.lineWidth, height: bounds.height)
} else {
return .init(width: bounds.width, height: 1)
return .init(width: bounds.width, height: Self.lineWidth)
}
}
@ -103,7 +103,7 @@ open class Line: View {
guard let context = UIGraphicsGetCurrentContext() else { return }
context.setStrokeColor(lineViewColorConfiguration.getColor(self).cgColor)
context.setLineWidth(lineWidth)
context.setLineWidth(Self.lineWidth)
if orientation == .horizontal {
context.move(to: CGPoint(x: 0, y: rect.height / 2))