mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 01:12:15 -07:00
Negative currentSize means we don't render the widget yet, return a default value.
This commit is contained in:
parent
b5b919b738
commit
4c4cfeff12
1 changed files with 4 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue