diff --git a/VDS/Components/BadgeIndicator/BadgeIndicator.swift b/VDS/Components/BadgeIndicator/BadgeIndicator.swift index 3f202b01..6fa6d212 100644 --- a/VDS/Components/BadgeIndicator/BadgeIndicator.swift +++ b/VDS/Components/BadgeIndicator/BadgeIndicator.swift @@ -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 {