mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-23 19:25:55 +01:00
Text rendering cosmetics
This commit is contained in:
parent
a7294b30f8
commit
c8e8f0013f
@ -26,7 +26,7 @@ int TextItem::avgCharWidth() const
|
||||
ratio *= 1.1;
|
||||
// The rest (Latin scripts, Arabic, ...)
|
||||
} else {
|
||||
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.7 : 0.55;
|
||||
ratio = (_font.capitalization() == QFont::AllUppercase) ? 0.7 : 0.58;
|
||||
if (_font.bold())
|
||||
ratio *= 1.1;
|
||||
}
|
||||
|
@ -130,7 +130,8 @@ void TextPointItem::paint(QPainter *painter) const
|
||||
QRectF textRect;
|
||||
|
||||
if (!_icon.isNull()) {
|
||||
textRect = computeTextRect(true);
|
||||
textRect = (_anchor != Text::Center)
|
||||
? computeTextRect(true) : _boundingRect;
|
||||
#ifdef ENABLE_HIDPI
|
||||
painter->drawImage(_pos - QPointF(_icon.width()
|
||||
/ _icon.devicePixelRatioF() / 2, _icon.height()
|
||||
|
Loading…
Reference in New Issue
Block a user