1
1
import { VerticalTextAlignment , createNativeAttributedString , verticalTextAlignmentProperty } from '@nativescript-community/text' ;
2
- import { Color , CoreTypes , Font , FormattedString , Span , View } from '@nativescript/core' ;
2
+ import { Color , CoreTypes , Font , FormattedString , Span , Utils , View } from '@nativescript/core' ;
3
3
import {
4
4
borderBottomWidthProperty ,
5
5
borderLeftWidthProperty ,
@@ -18,8 +18,8 @@ import {
18
18
whiteSpaceProperty
19
19
} from '@nativescript/core/ui/text-base' ;
20
20
import { maxLinesProperty } from '@nativescript/core/ui/text-base/text-base-common' ;
21
+ import { iOSNativeHelper } from '@nativescript/core/utils' ;
21
22
import { isNullOrUndefined , isString } from '@nativescript/core/utils/types' ;
22
- import { Utils } from '@nativescript/core' ;
23
23
import { TextShadow } from './label' ;
24
24
import {
25
25
LabelBase ,
@@ -32,7 +32,6 @@ import {
32
32
selectableProperty ,
33
33
textShadowProperty
34
34
} from './label-common' ;
35
- import { iOSNativeHelper } from '@nativescript/core/utils' ;
36
35
37
36
export { createNativeAttributedString , enableIOSDTCoreText } from '@nativescript-community/text' ;
38
37
export * from './label-common' ;
@@ -311,15 +310,15 @@ export class Label extends LabelBase {
311
310
public onMeasure ( widthMeasureSpec : number , heightMeasureSpec : number ) : void {
312
311
const nativeView = this . nativeTextViewProtected ;
313
312
if ( nativeView ) {
314
- const width = layout . getMeasureSpecSize ( widthMeasureSpec ) ;
315
- const widthMode = layout . getMeasureSpecMode ( widthMeasureSpec ) ;
313
+ const width = Utils . layout . getMeasureSpecSize ( widthMeasureSpec ) ;
314
+ const widthMode = Utils . layout . getMeasureSpecMode ( widthMeasureSpec ) ;
316
315
317
- const height = layout . getMeasureSpecSize ( heightMeasureSpec ) ;
318
- const heightMode = layout . getMeasureSpecMode ( heightMeasureSpec ) ;
316
+ const height = Utils . layout . getMeasureSpecSize ( heightMeasureSpec ) ;
317
+ const heightMode = Utils . layout . getMeasureSpecMode ( heightMeasureSpec ) ;
319
318
let resetFont ;
320
319
if ( this . autoFontSize ) {
321
- const finiteWidth = widthMode === layout . EXACTLY ;
322
- const finiteHeight = heightMode === layout . EXACTLY ;
320
+ const finiteWidth = widthMode === Utils . layout . EXACTLY ;
321
+ const finiteHeight = heightMode === Utils . layout . EXACTLY ;
323
322
if ( ! finiteWidth || ! finiteHeight ) {
324
323
resetFont = this . updateAutoFontSize ( {
325
324
textView : nativeView ,
@@ -330,12 +329,12 @@ export class Label extends LabelBase {
330
329
}
331
330
}
332
331
333
- const desiredSize = layout . measureNativeView ( nativeView , width , widthMode , height , heightMode ) ;
332
+ const desiredSize = Utils . layout . measureNativeView ( nativeView , width , widthMode , height , heightMode ) ;
334
333
if ( ! this . formattedText && ! this . html && resetFont ) {
335
334
nativeView . font = resetFont ;
336
335
}
337
336
338
- const labelWidth = widthMode === layout . AT_MOST ? Math . min ( desiredSize . width , width ) : desiredSize . width ;
337
+ const labelWidth = widthMode === Utils . layout . AT_MOST ? Math . min ( desiredSize . width , width ) : desiredSize . width ;
339
338
// const labelHeight = heightMode === layout.AT_MOST ? Math.min(desiredSize.height, height) : desiredSize.height;
340
339
const measureWidth = Math . max ( labelWidth , this . effectiveMinWidth ) ;
341
340
const measureHeight = Math . max ( desiredSize . height , this . effectiveMinHeight ) ;
0 commit comments