File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -791,7 +791,11 @@ export class Label extends LabelBase {
791
791
return currentFont ;
792
792
}
793
793
const autoSizeKey = fixedWidth + '_' + fixedHeight ;
794
- if ( ! force && autoSizeKey === this . _lastAutoSizeKey ) {
794
+ const fontSize = this . style . fontSize || 17 ;
795
+ let expectFont = ( this . style . fontInternal || Font . default ) . getUIFont ( UIFont . systemFontOfSize ( fontSize ) ) ;
796
+ //if we are not on the "default" font size we need to measure again or we could break
797
+ //the layout behavior like for flexbox where there are multiple measure passes
798
+ if ( ! force && autoSizeKey === this . _lastAutoSizeKey && expectFont . pointSize === textView . font . pointSize ) {
795
799
return null ;
796
800
}
797
801
currentFont = textView . font ;
@@ -800,9 +804,6 @@ export class Label extends LabelBase {
800
804
// we need to reset verticalTextAlignment or computation will be wrong
801
805
this . updateTextContainerInset ( false ) ;
802
806
803
- const fontSize = this . style . fontSize || 17 ;
804
- let expectFont : UIFont = ( this . style . fontInternal || Font . default ) . getUIFont ( UIFont . systemFontOfSize ( fontSize ) ) ;
805
- //first reset the font size
806
807
let expectSize ;
807
808
808
809
const stepSize = this . autoFontSizeStep || 1 ;
@@ -814,6 +815,7 @@ export class Label extends LabelBase {
814
815
textView . font = font ;
815
816
}
816
817
} ;
818
+ //first reset the font size
817
819
updateFontSize ( expectFont ) ;
818
820
const size = ( ) => {
819
821
if ( nbLines === 1 ) {
You can’t perform that action at this time.
0 commit comments