Merge branch 'bugfix/line' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios.git into mbruce/bugfixes
This commit is contained in:
commit
3f7905c0e4
@ -56,12 +56,15 @@ open class Line: View {
|
|||||||
/// Allows to render the line vertically.
|
/// Allows to render the line vertically.
|
||||||
open var orientation: Orientation = .horizontal { didSet { setNeedsUpdate() } }
|
open var orientation: Orientation = .horizontal { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
|
/// Line Color for current Style and Surface.
|
||||||
|
open var lineColor: UIColor { lineViewColorConfiguration.getColor(self) }
|
||||||
|
|
||||||
/// The natural size for the receiving view, considering only properties of the view itself.
|
/// The natural size for the receiving view, considering only properties of the view itself.
|
||||||
open override var intrinsicContentSize: CGSize {
|
open override var intrinsicContentSize: CGSize {
|
||||||
if orientation == .vertical {
|
if orientation == .vertical {
|
||||||
return .init(width: 1, height: bounds.height)
|
return .init(width: lineWidth, height: bounds.height)
|
||||||
} else {
|
} else {
|
||||||
return .init(width: bounds.width, height: 1)
|
return .init(width: bounds.width, height: lineWidth)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +105,7 @@ open class Line: View {
|
|||||||
open override func draw(_ rect: CGRect) {
|
open override func draw(_ rect: CGRect) {
|
||||||
guard let context = UIGraphicsGetCurrentContext() else { return }
|
guard let context = UIGraphicsGetCurrentContext() else { return }
|
||||||
|
|
||||||
context.setStrokeColor(lineViewColorConfiguration.getColor(self).cgColor)
|
context.setStrokeColor(lineColor.cgColor)
|
||||||
context.setLineWidth(lineWidth)
|
context.setLineWidth(lineWidth)
|
||||||
|
|
||||||
if orientation == .horizontal {
|
if orientation == .horizontal {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user