Negative currentSize means we don't render the widget yet, return a default value.

This commit is contained in:
Lukas Brübach 2024-12-16 01:33:48 +01:00 committed by ZeldaZach
parent b5b919b738
commit 4c4cfeff12
No known key found for this signature in database

View file

@ -57,6 +57,10 @@ float DynamicFontSizeLabel::getWidgetMaximumFontSize(QWidget *widget, QString te
return currentSize;
}
if (currentSize < 0) {
return 1;
}
/* Only stop when step is small enough and new size is smaller than QWidget */
while(step>FONT_PRECISION || (currentHeight > widgetHeight) || (currentWidth > widgetWidth)){
/* Keep last tested value */