revert: "fix(core): Proper line-height calculation" (#10647)

This commit is contained in:
Dimitris-Rafail Katsampas
2024-11-19 05:48:51 +02:00
committed by GitHub
parent 4f367483ef
commit 4e54c676a3
3 changed files with 5 additions and 16 deletions

View File

@@ -26,8 +26,7 @@
BOOL isTextView = [self isKindOfClass:[UITextView class]];
if (lineHeight > 0) {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
// Note: Avoid using lineSpacing as it will append the height as extra space
paragraphStyle.minimumLineHeight = lineHeight;
paragraphStyle.lineSpacing = lineHeight;
// make sure a possible previously set text alignment setting is not lost when line height is specified
if ([self isKindOfClass:[UIButton class]]) {
paragraphStyle.alignment = ((UIButton*)self).titleLabel.textAlignment;
@@ -89,8 +88,7 @@
BOOL isLabel = [self isKindOfClass:[UILabel class]];
if (lineHeight > 0) {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
// Note: Avoid using lineSpacing as it will append the height as extra space
paragraphStyle.minimumLineHeight = lineHeight;
paragraphStyle.lineSpacing = lineHeight;
// make sure a possible previously set text alignment setting is not lost when line height is specified
if ([self isKindOfClass:[UIButton class]]) {
paragraphStyle.alignment = ((UIButton*)self).titleLabel.textAlignment;