fix(android): line-height (#8751)

This commit is contained in:
Nathan Walker
2020-08-07 08:46:42 -07:00
committed by GitHub
parent 02dd5ac965
commit 4708ff4e68
5 changed files with 6 additions and 7 deletions

View File

@@ -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",

View File

@@ -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 {

View File

@@ -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"

View File

@@ -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",

View File

@@ -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": {