[graphics/drawy/gsoc2026] src/gui/item: fix: account for document margin in minWrapWidth

Abdelhadi Wael <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9ab918401c33e5245ba89a6e8107c27a659de1e5 by Abdelhadi Wael.
Committed on 21/07/2026 at 23:55.
Pushed by mlaurent into branch 'gsoc2026'.

fix: account for document margin in minWrapWidth

M  +1    -1    src/gui/item/text.cpp

https://invent.kde.org/graphics/drawy/-/commit/9ab918401c33e5245ba89a6e8107c27a659de1e5

diff --git a/src/gui/item/text.cpp b/src/gui/item/text.cpp
index 4a16a007..6f4e0b6e 100644
--- a/src/gui/item/text.cpp
+++ b/src/gui/item/text.cpp
@@ -580,5 +580,5 @@ void TextItem::setWrapWidth(const qreal wrapWidth)
 qreal TextItem::minWrapWidth() const
 {
     const QFontMetricsF metrics{getFont()};
-    return metrics.maxWidth();
+    return metrics.maxWidth() + 2 * m_document.documentMargin();
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.