removed padding now working on ratio of pointSize
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
a0ac8991f7
commit
190e29bbd2
@ -59,21 +59,6 @@ open class BadgeIndicator: View {
|
|||||||
case medium = "Medium"
|
case medium = "Medium"
|
||||||
case small = "Small"
|
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 {
|
public var padding: CGFloat {
|
||||||
switch self {
|
switch self {
|
||||||
case .xxlarge:
|
case .xxlarge:
|
||||||
@ -114,7 +99,7 @@ open class BadgeIndicator: View {
|
|||||||
return TextStyle(rawValue: "\(self.rawValue)BadgeIndicator",
|
return TextStyle(rawValue: "\(self.rawValue)BadgeIndicator",
|
||||||
fontFace: style.fontFace,
|
fontFace: style.fontFace,
|
||||||
pointSize: pointSize,
|
pointSize: pointSize,
|
||||||
lineHeight: style.lineHeight,
|
lineHeight: pointSize * (16.0 / 12.0),
|
||||||
letterSpacing: style.letterSpacing)
|
letterSpacing: style.letterSpacing)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +283,9 @@ open class BadgeIndicator: View {
|
|||||||
|
|
||||||
open override func layoutSubviews() {
|
open override func layoutSubviews() {
|
||||||
super.layoutSubviews()
|
super.layoutSubviews()
|
||||||
labelWidthConstraint?.constant = textSize.minimumSize
|
let size = textSize.textStyle.lineHeight
|
||||||
labelHeightConstraint?.constant = textSize.minimumSize
|
labelWidthConstraint?.constant = size
|
||||||
|
labelHeightConstraint?.constant = size
|
||||||
layer.cornerRadius = frame.size.height / 2
|
layer.cornerRadius = frame.size.height / 2
|
||||||
|
|
||||||
if hideBorder {
|
if hideBorder {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user