From 4708ff4e680669c3747837be036c6cb86b4b46c6 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Fri, 7 Aug 2020 08:46:42 -0700 Subject: [PATCH] fix(android): line-height (#8751) --- nativescript-core/package.json | 2 +- nativescript-core/ui/text-base/text-base.android.ts | 5 ++--- package.json | 2 +- tns-core-modules-package/package.json | 2 +- tns-platform-declarations/package.json | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/nativescript-core/package.json b/nativescript-core/package.json index 91476997c..43252ed81 100644 --- a/nativescript-core/package.json +++ b/nativescript-core/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "NativeScript Core Modules", - "version": "6.5.12", + "version": "6.5.13", "homepage": "https://www.nativescript.org", "repository": { "type": "git", diff --git a/nativescript-core/ui/text-base/text-base.android.ts b/nativescript-core/ui/text-base/text-base.android.ts index c7d6dd55b..c02273f28 100644 --- a/nativescript-core/ui/text-base/text-base.android.ts +++ b/nativescript-core/ui/text-base/text-base.android.ts @@ -334,11 +334,10 @@ export class TextBase extends TextBaseCommon { } [lineHeightProperty.getDefault](): number { - return this.nativeTextViewProtected.getLineHeight() / layout.getDisplayDensity(); + return this.nativeView.getLineSpacingExtra() / layout.getDisplayDensity(); } [lineHeightProperty.setNative](value: number) { - const fontHeight = this.nativeTextViewProtected.getPaint().getFontMetricsInt(null); - this.nativeTextViewProtected.setLineSpacing(Math.max(value - fontHeight, 0) * layout.getDisplayDensity(), 1); + this.nativeView.setLineSpacing(value * layout.getDisplayDensity(), 1); } [fontInternalProperty.getDefault](): android.graphics.Typeface { diff --git a/package.json b/package.json index 1cde00b44..75a6c863e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "NativeScript", "description": "NativeScript Core Modules", "homepage": "https://www.nativescript.org", - "version": "6.5.12", + "version": "6.5.13", "repository": { "type": "git", "url": "https://github.com/NativeScript/NativeScript" diff --git a/tns-core-modules-package/package.json b/tns-core-modules-package/package.json index 9facf54b0..cea94f7e9 100644 --- a/tns-core-modules-package/package.json +++ b/tns-core-modules-package/package.json @@ -3,7 +3,7 @@ "main": "index", "types": "index.d.ts", "description": "NativeScript Core Modules", - "version": "6.5.12", + "version": "6.5.13", "homepage": "https://www.nativescript.org", "repository": { "type": "git", diff --git a/tns-platform-declarations/package.json b/tns-platform-declarations/package.json index 28c605ea6..bf5c55227 100644 --- a/tns-platform-declarations/package.json +++ b/tns-platform-declarations/package.json @@ -1,6 +1,6 @@ { "name": "tns-platform-declarations", - "version": "6.5.12", + "version": "6.5.13", "description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects", "main": "", "scripts": {