From 190e29bbd267b845ef84944922a8a0eba54d7d21 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 16 Jun 2023 09:35:27 -0500 Subject: [PATCH] removed padding now working on ratio of pointSize Signed-off-by: Matt Bruce --- .../BadgeIndicator/BadgeIndicator.swift | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) 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 {