remvoed logic

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-30 09:18:28 -05:00
parent ba4bd4e1f5
commit ee07116952

View File

@ -342,17 +342,15 @@ open class RadioBoxBase<ModelType: RadioBoxModel>: Control<ModelType>, Changable
// Accounts for any size changes
layer.setNeedsDisplay()
}
open override func draw(_ layer: CALayer, in ctx: CGContext) {
let borderColor = radioBoxBorderColorConfiguration.getColor(model)
if let shapeLayer = shapeLayer, let sublayers = layer.sublayers, sublayers.contains(shapeLayer) {
shapeLayer.removeFromSuperlayer()
self.shapeLayer = nil
}
if shapeLayer == nil && model.strikethrough {
shapeLayer?.removeFromSuperlayer()
shapeLayer = nil
if model.strikethrough {
let bounds = selectorView.bounds
let length = max(bounds.size.height, bounds.size.width)
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.lineWidth = strikeThroughLineThickness
border.strokeColor = borderColor.cgColor
let linePath = UIBezierPath()
let offsetPercent: CGFloat = 0.005
linePath.move(to: CGPoint(x: selectorCornerRadius, y: bounds.height * (1 - offsetPercent)))
linePath.addLine(to: CGPoint(x: bounds.width - selectorCornerRadius, y: bounds.height * offsetPercent))