Skip to content

Commit 4708ff4

Browse files
authored
fix(android): line-height (NativeScript#8751)
1 parent 02dd5ac commit 4708ff4

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

nativescript-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "index",
44
"types": "index.d.ts",
55
"description": "NativeScript Core Modules",
6-
"version": "6.5.12",
6+
"version": "6.5.13",
77
"homepage": "https://www.nativescript.org",
88
"repository": {
99
"type": "git",

nativescript-core/ui/text-base/text-base.android.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,10 @@ export class TextBase extends TextBaseCommon {
334334
}
335335

336336
[lineHeightProperty.getDefault](): number {
337-
return this.nativeTextViewProtected.getLineHeight() / layout.getDisplayDensity();
337+
return this.nativeView.getLineSpacingExtra() / layout.getDisplayDensity();
338338
}
339339
[lineHeightProperty.setNative](value: number) {
340-
const fontHeight = this.nativeTextViewProtected.getPaint().getFontMetricsInt(null);
341-
this.nativeTextViewProtected.setLineSpacing(Math.max(value - fontHeight, 0) * layout.getDisplayDensity(), 1);
340+
this.nativeView.setLineSpacing(value * layout.getDisplayDensity(), 1);
342341
}
343342

344343
[fontInternalProperty.getDefault](): android.graphics.Typeface {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "NativeScript",
33
"description": "NativeScript Core Modules",
44
"homepage": "https://www.nativescript.org",
5-
"version": "6.5.12",
5+
"version": "6.5.13",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/NativeScript/NativeScript"

tns-core-modules-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"main": "index",
44
"types": "index.d.ts",
55
"description": "NativeScript Core Modules",
6-
"version": "6.5.12",
6+
"version": "6.5.13",
77
"homepage": "https://www.nativescript.org",
88
"repository": {
99
"type": "git",

tns-platform-declarations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tns-platform-declarations",
3-
"version": "6.5.12",
3+
"version": "6.5.13",
44
"description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects",
55
"main": "",
66
"scripts": {

0 commit comments

Comments
 (0)