From 2fdbc25ca3c8a9cdb9b822485cec0b7be2fa505e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 15 Nov 2024 20:23:48 +0100 Subject: [PATCH] A better QPainter text rect inconsistency workaround --- src/map/textpointitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/textpointitem.cpp b/src/map/textpointitem.cpp index c3a2af6d..d5986139 100644 --- a/src/map/textpointitem.cpp +++ b/src/map/textpointitem.cpp @@ -27,7 +27,7 @@ TextPointItem::TextPointItem(const QPoint &point, const QString *text, QFontMetrics fm(*_font); int limit = _font->pixelSize() * MAX_TEXT_WIDTH; _textRect = fm.boundingRect(QRect(0, 0, limit, 0), FLAGS, *_text); - _textRect.adjust(0, 0, 1, 1); + _textRect.adjust(-1, 0, 2, 0); if (_bgColor && _textRect.width() < _font->pixelSize() * MIN_BOX_WIDTH) expand(_textRect, _font->pixelSize() * MIN_BOX_WIDTH);