File tree 1 file changed +6
-13
lines changed
1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -855,10 +855,8 @@ export class Label extends LabelBase {
855
855
} ;
856
856
size ( ) ;
857
857
if ( expectSize . height > fixedHeight || expectSize . width > fixedWidth ) {
858
- while (
859
- ( expectSize . height > fixedHeight || expectSize . width > fixedWidth ) &&
860
- expectFont . pointSize > ( this . minFontSize || 12 )
861
- ) {
858
+ const minFontSize = this . minFontSize || 12 ;
859
+ while ( ( expectSize . height > fixedHeight || expectSize . width > fixedWidth ) && expectFont . pointSize > minFontSize ) {
862
860
const newFont = expectFont . fontWithSize ( expectFont . pointSize - stepSize ) ;
863
861
updateFontSize ( newFont ) ;
864
862
size ( ) ;
@@ -873,21 +871,16 @@ export class Label extends LabelBase {
873
871
}
874
872
}
875
873
} else {
876
- while (
877
- ( expectSize . height < fixedHeight || expectSize . width < fixedWidth ) &&
878
- expectFont . pointSize < ( this . maxFontSize || 200 )
879
- ) {
874
+ const maxFontSize = this . maxFontSize || 200 ;
875
+ while ( expectSize . height < fixedHeight && expectSize . width < fixedWidth && expectFont . pointSize < maxFontSize ) {
880
876
const newFont = expectFont . fontWithSize ( expectFont . pointSize + stepSize ) ;
881
877
updateFontSize ( newFont ) ;
882
-
883
878
size ( ) ;
884
-
885
- if ( expectSize . height <= fixedHeight || expectSize . width <= fixedWidth ) {
879
+ if ( expectSize . height <= fixedHeight && expectSize . width <= fixedWidth ) {
886
880
expectFont = newFont ;
887
881
} else {
888
- expectFont = newFont ;
889
882
if ( ! this . formattedText && ! this . html ) {
890
- textView . font = newFont ;
883
+ textView . font = expectFont ;
891
884
}
892
885
break ;
893
886
}
You can’t perform that action at this time.
0 commit comments