File tree 2 files changed +0
-33
lines changed
2 files changed +0
-33
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,8 @@ - (void)nativeScriptSetTextDecorationAndTransform:(NSString*)text textDecoration
30
30
// make sure a possible previously set text alignment setting is not lost when line height is specified
31
31
if ([self isKindOfClass: [UIButton class ]]) {
32
32
paragraphStyle.alignment = ((UIButton*)self).titleLabel .textAlignment ;
33
-
34
- if (((UIButton*)self).titleLabel .font ) {
35
- paragraphStyle.lineSpacing = lineHeight - ((UIButton*)self).titleLabel .font .lineHeight ;
36
- }
37
33
} else {
38
34
paragraphStyle.alignment = ((UILabel*)self).textAlignment ;
39
-
40
- if (((UILabel*)self).font ) {
41
- paragraphStyle.lineSpacing = lineHeight - ((UILabel*)self).font .lineHeight ;
42
- }
43
35
}
44
36
45
37
if ([self isKindOfClass: [UILabel class ]]) {
@@ -100,17 +92,9 @@ -(void)nativeScriptSetFormattedTextDecorationAndTransform:(NSDictionary*)details
100
92
// make sure a possible previously set text alignment setting is not lost when line height is specified
101
93
if ([self isKindOfClass: [UIButton class ]]) {
102
94
paragraphStyle.alignment = ((UIButton*)self).titleLabel .textAlignment ;
103
-
104
- if (((UIButton*)self).titleLabel .font ) {
105
- paragraphStyle.lineSpacing = lineHeight - ((UIButton*)self).titleLabel .font .lineHeight ;
106
- }
107
95
} else {
108
96
// Paragraph alignment is also important for tappable spans as NSTextContainer takes it into account
109
97
paragraphStyle.alignment = ((UILabel*)self).textAlignment ;
110
-
111
- if (((UILabel*)self).font ) {
112
- paragraphStyle.lineSpacing = lineHeight - ((UILabel*)self).font .lineHeight ;
113
- }
114
98
}
115
99
116
100
if (isLabel) {
Original file line number Diff line number Diff line change @@ -367,14 +367,6 @@ export class TextBase extends TextBaseCommon {
367
367
if ( ! this . formattedText ) {
368
368
this . nativeTextViewProtected . setTextSize ( value ) ;
369
369
370
- // Re-calculate line-height
371
- if ( this . lineHeight != 0 ) {
372
- // It's done automatically for API 28+
373
- if ( SDK_VERSION < 28 ) {
374
- this . _setLineHeightLegacy ( this . lineHeight ) ;
375
- }
376
- }
377
-
378
370
// Re-calculate letter-spacing
379
371
if ( this . letterSpacing != 0 ) {
380
372
this . _updateLetterSpacing ( this . letterSpacing ) ;
@@ -494,15 +486,6 @@ export class TextBase extends TextBaseCommon {
494
486
}
495
487
}
496
488
497
- _setLineHeightLegacy ( value : number ) : void {
498
- const dpValue = value * layout . getDisplayDensity ( ) ;
499
- const fontHeight = this . nativeTextViewProtected . getPaint ( ) . getFontMetricsInt ( null ) ;
500
- // Actual line spacing is the diff of line height and font height
501
- const lineSpacing = Math . max ( dpValue - fontHeight , 0 ) ;
502
-
503
- this . nativeTextViewProtected . setLineSpacing ( lineSpacing , 1 ) ;
504
- }
505
-
506
489
_updateLetterSpacing ( value : number ) : void {
507
490
const emValue = value / this . fontSize ;
508
491
org . nativescript . widgets . ViewHelper . setLetterspacing ( this . nativeTextViewProtected , emValue ) ;
You can’t perform that action at this time.
0 commit comments