Fixed bug in calculating height in autoresize mode

This commit is contained in:
Blu3train 2021-05-19 19:02:58 +02:00 committed by Akash Mozumdar
parent 2f08ab1e9b
commit b236a50a8f

View File

@ -245,7 +245,7 @@ private:
if (!autoResizeHeight) return; if (!autoResizeHeight) return;
QFontMetrics fontMetrics(ui.display->font(), ui.display); QFontMetrics fontMetrics(ui.display->font(), ui.display);
auto boundingRect = fontMetrics.boundingRect(0, 0, width(), INT_MAX, Qt::TextWordWrap, sentence); auto boundingRect = fontMetrics.boundingRect(0, 0, width()-20, INT_MAX, Qt::TextWordWrap, sentence);
int newHeight = boundingRect.height() + 30; int newHeight = boundingRect.height() + 30;
int currHeight = height(); int currHeight = height();