Skip to content

Commit e952796

Browse files
committed
chore: N 8.4 fixes
1 parent f00f8a1 commit e952796

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Diff for: src/label-common.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
booleanConverter,
1313
fontInternalProperty
1414
} from '@nativescript/core';
15-
import { layout } from '@nativescript/core/utils/layout-helper';
15+
import { Utils } from '@nativescript/core';
1616
import { Label as LabelViewDefinition, LineBreak, TextShadow } from './label';
1717

1818
// declare module '@nativescript/core/ui/text-base/formatted-string' {
@@ -147,7 +147,7 @@ maxFontSizeProperty.register(Style);
147147

148148
function parseDIPs(value: string): CoreTypes.dip {
149149
if (value.indexOf('px') !== -1) {
150-
return layout.toDeviceIndependentPixels(parseFloat(value.replace('px', '').trim()));
150+
return Utils.layout.toDeviceIndependentPixels(parseFloat(value.replace('px', '').trim()));
151151
} else {
152152
return parseFloat(value.replace('dip', '').trim());
153153
}

Diff for: src/label.android.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
} from '@nativescript/core/ui/text-base';
4343
import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common';
4444
import lazy from '@nativescript/core/utils/lazy';
45-
import { layout } from '@nativescript/core/utils/layout-helper';
45+
import { Utils } from '@nativescript/core';
4646
import { Label as LabelViewDefinition, LineBreak } from './label';
4747
import { autoFontSizeProperty, lineBreakProperty, selectableProperty, textShadowProperty } from './label-common';
4848

Diff for: src/label.ios.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from '@nativescript/core/ui/text-base';
2020
import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common';
2121
import { isNullOrUndefined, isString } from '@nativescript/core/utils/types';
22-
import { layout } from '@nativescript/core/utils/layout-helper';
22+
import { Utils } from '@nativescript/core';
2323
import { TextShadow } from './label';
2424
import {
2525
LabelBase,
@@ -241,10 +241,10 @@ export class Label extends LabelBase {
241241

242242
updateTextContainerInset(applyVerticalTextAlignment = true) {
243243
const tv = this.nativeTextViewProtected;
244-
const top = layout.toDeviceIndependentPixels(this.effectivePaddingTop + this.effectiveBorderTopWidth);
245-
const right = layout.toDeviceIndependentPixels(this.effectivePaddingRight + this.effectiveBorderRightWidth);
246-
const bottom = layout.toDeviceIndependentPixels(this.effectivePaddingBottom + this.effectiveBorderBottomWidth);
247-
const left = layout.toDeviceIndependentPixels(this.effectivePaddingLeft + this.effectiveBorderLeftWidth);
244+
const top = Utils.layout.toDeviceIndependentPixels(this.effectivePaddingTop + this.effectiveBorderTopWidth);
245+
const right = Utils.layout.toDeviceIndependentPixels(this.effectivePaddingRight + this.effectiveBorderRightWidth);
246+
const bottom = Utils.layout.toDeviceIndependentPixels(this.effectivePaddingBottom + this.effectiveBorderBottomWidth);
247+
const left = Utils.layout.toDeviceIndependentPixels(this.effectivePaddingLeft + this.effectiveBorderLeftWidth);
248248
if (
249249
!applyVerticalTextAlignment ||
250250
!this.verticalTextAlignment ||
@@ -323,8 +323,8 @@ export class Label extends LabelBase {
323323
if (!finiteWidth || !finiteHeight) {
324324
resetFont = this.updateAutoFontSize({
325325
textView: nativeView,
326-
width: layout.toDeviceIndependentPixels(width),
327-
height: layout.toDeviceIndependentPixels(height),
326+
width: Utils.layout.toDeviceIndependentPixels(width),
327+
height: Utils.layout.toDeviceIndependentPixels(height),
328328
onlyMeasure: true
329329
});
330330
}

0 commit comments

Comments
 (0)