remvoed logic
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ba4bd4e1f5
commit
ee07116952
@ -342,17 +342,15 @@ open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, Changable
|
|||||||
// Accounts for any size changes
|
// Accounts for any size changes
|
||||||
layer.setNeedsDisplay()
|
layer.setNeedsDisplay()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func draw(_ layer: CALayer, in ctx: CGContext) {
|
open override func draw(_ layer: CALayer, in ctx: CGContext) {
|
||||||
|
|
||||||
let borderColor = radioBoxBorderColorConfiguration.getColor(model)
|
let borderColor = radioBoxBorderColorConfiguration.getColor(model)
|
||||||
|
|
||||||
if let shapeLayer = shapeLayer, let sublayers = layer.sublayers, sublayers.contains(shapeLayer) {
|
shapeLayer?.removeFromSuperlayer()
|
||||||
shapeLayer.removeFromSuperlayer()
|
shapeLayer = nil
|
||||||
self.shapeLayer = nil
|
|
||||||
}
|
if model.strikethrough {
|
||||||
|
|
||||||
if shapeLayer == nil && model.strikethrough {
|
|
||||||
let bounds = selectorView.bounds
|
let bounds = selectorView.bounds
|
||||||
let length = max(bounds.size.height, bounds.size.width)
|
let length = max(bounds.size.height, bounds.size.width)
|
||||||
guard length > 0.0, shapeLayer == nil else { return }
|
guard length > 0.0, shapeLayer == nil else { return }
|
||||||
@ -363,9 +361,9 @@ open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, Changable
|
|||||||
border.opacity = 1.0
|
border.opacity = 1.0
|
||||||
border.lineWidth = strikeThroughLineThickness
|
border.lineWidth = strikeThroughLineThickness
|
||||||
border.strokeColor = borderColor.cgColor
|
border.strokeColor = borderColor.cgColor
|
||||||
|
|
||||||
let linePath = UIBezierPath()
|
let linePath = UIBezierPath()
|
||||||
|
|
||||||
let offsetPercent: CGFloat = 0.005
|
let offsetPercent: CGFloat = 0.005
|
||||||
linePath.move(to: CGPoint(x: selectorCornerRadius, y: bounds.height * (1 - offsetPercent)))
|
linePath.move(to: CGPoint(x: selectorCornerRadius, y: bounds.height * (1 - offsetPercent)))
|
||||||
linePath.addLine(to: CGPoint(x: bounds.width - selectorCornerRadius, y: bounds.height * offsetPercent))
|
linePath.addLine(to: CGPoint(x: bounds.width - selectorCornerRadius, y: bounds.height * offsetPercent))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user