Skip to content

Commit ef8b6de

Browse files
committed
fix text cut
1 parent 90c0041 commit ef8b6de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ios/StrokedTextLabel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class StrokedTextLabel: UILabel {
1313
private var textInsets: UIEdgeInsets = .zero
1414

1515
public func updateTextInsets() {
16-
let strokePadding = outlineWidth / 2
17-
textInsets = UIEdgeInsets(top: 0, left: strokePadding, bottom: 0, right: strokePadding)
16+
textInsets = UIEdgeInsets(top: outlineWidth, left: outlineWidth, bottom: outlineWidth, right: outlineWidth)
1817
}
1918

2019
var outlineWidth: CGFloat = 0
@@ -54,9 +53,10 @@ class StrokedTextLabel: UILabel {
5453
if customWidth > 0 {
5554
contentSize.width = customWidth
5655
} else {
57-
contentSize.width += (textInsets.left + textInsets.right)
56+
contentSize.width += outlineWidth * 2
5857
}
5958

59+
contentSize.height += outlineWidth * 2
6060
return contentSize
6161
}
6262
}

0 commit comments

Comments
 (0)