fixed bug in drawing
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
85c398c820
commit
02a5c1022d
@ -335,8 +335,8 @@ open class RadioButtonBase: Control, Errorable {
|
|||||||
self.shapeLayer = nil
|
self.shapeLayer = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
let bounds = selectorView.bounds
|
let bounds = radioButtonSize
|
||||||
let length = max(bounds.size.height, bounds.size.width)
|
let length = max(bounds.height, bounds.width)
|
||||||
guard length > 0.0, shapeLayer == nil else { return }
|
guard length > 0.0, shapeLayer == nil else { return }
|
||||||
|
|
||||||
//get the colors
|
//get the colors
|
||||||
@ -346,7 +346,7 @@ open class RadioButtonBase: Control, Errorable {
|
|||||||
|
|
||||||
selectorView.backgroundColor = backgroundColor
|
selectorView.backgroundColor = backgroundColor
|
||||||
selectorView.layer.borderColor = borderColor.cgColor
|
selectorView.layer.borderColor = borderColor.cgColor
|
||||||
selectorView.layer.cornerRadius = selectorView.bounds.width * 0.5
|
selectorView.layer.cornerRadius = bounds.width * 0.5
|
||||||
selectorView.layer.borderWidth = VDSFormControls.widthBorder
|
selectorView.layer.borderWidth = VDSFormControls.widthBorder
|
||||||
|
|
||||||
if shapeLayer == nil {
|
if shapeLayer == nil {
|
||||||
@ -357,7 +357,7 @@ open class RadioButtonBase: Control, Errorable {
|
|||||||
height: radioButtonSelectedSize.height))
|
height: radioButtonSelectedSize.height))
|
||||||
let shapeLayer = CAShapeLayer()
|
let shapeLayer = CAShapeLayer()
|
||||||
self.shapeLayer = shapeLayer
|
self.shapeLayer = shapeLayer
|
||||||
shapeLayer.frame = bounds
|
shapeLayer.frame = selectorView.bounds
|
||||||
layer.addSublayer(shapeLayer)
|
layer.addSublayer(shapeLayer)
|
||||||
shapeLayer.fillColor = radioSelectedColor.cgColor
|
shapeLayer.fillColor = radioSelectedColor.cgColor
|
||||||
shapeLayer.path = bezierPath.cgPath
|
shapeLayer.path = bezierPath.cgPath
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user