removed padding now working on ratio of pointSize

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-06-16 09:35:27 -05:00
parent a0ac8991f7
commit 190e29bbd2

View File

@ -59,21 +59,6 @@ open class BadgeIndicator: View {
case medium = "Medium"
case small = "Small"
public var minimumSize: CGFloat {
switch self {
case .xxlarge:
return 29
case .xlarge:
return 24
case .large:
return 20
case .medium:
return 18
case .small:
return 16
}
}
public var padding: CGFloat {
switch self {
case .xxlarge:
@ -114,7 +99,7 @@ open class BadgeIndicator: View {
return TextStyle(rawValue: "\(self.rawValue)BadgeIndicator",
fontFace: style.fontFace,
pointSize: pointSize,
lineHeight: style.lineHeight,
lineHeight: pointSize * (16.0 / 12.0),
letterSpacing: style.letterSpacing)
}
@ -298,8 +283,9 @@ open class BadgeIndicator: View {
open override func layoutSubviews() {
super.layoutSubviews()
labelWidthConstraint?.constant = textSize.minimumSize
labelHeightConstraint?.constant = textSize.minimumSize
let size = textSize.textStyle.lineHeight
labelWidthConstraint?.constant = size
labelHeightConstraint?.constant = size
layer.cornerRadius = frame.size.height / 2
if hideBorder {