Skip to content

Commit

Permalink
A better QPainter text rect inconsistency workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Nov 15, 2024
1 parent 734ba4b commit 2fdbc25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/map/textpointitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2fdbc25

Please sign in to comment.