mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-11-24 03:35:54 +01:00
Adjusted icon text alignment
This commit is contained in:
parent
148f79eaef
commit
8da172c0ff
@ -67,12 +67,12 @@ QRectF TextPointItem::moveTextRect(const QRectF &rect) const
|
|||||||
textRect.moveCenter(_pos);
|
textRect.moveCenter(_pos);
|
||||||
break;
|
break;
|
||||||
case Text::Left:
|
case Text::Left:
|
||||||
textRect.moveTopLeft(_pos - QPointF(-iconRect.width() / 2,
|
textRect.moveTopLeft(_pos - QPointF(-iconRect.width() / 2
|
||||||
textRect.height() / 2));
|
- font().pixelSize()/4.0, textRect.height() / 2));
|
||||||
break;
|
break;
|
||||||
case Text::Right:
|
case Text::Right:
|
||||||
textRect.moveTopRight(_pos - QPointF(iconRect.width() / 2,
|
textRect.moveTopRight(_pos - QPointF(iconRect.width() / 2
|
||||||
textRect.height() / 2));
|
+ font().pixelSize()/4.0, textRect.height() / 2));
|
||||||
break;
|
break;
|
||||||
case Text::Bottom:
|
case Text::Bottom:
|
||||||
textRect.moveTopLeft(_pos - QPointF(textRect.width() / 2,
|
textRect.moveTopLeft(_pos - QPointF(textRect.width() / 2,
|
||||||
@ -136,7 +136,7 @@ void TextPointItem::paint(QPainter *painter) const
|
|||||||
_icon.height() / 2), _icon);
|
_icon.height() / 2), _icon);
|
||||||
#endif // ENABLE_HIDPI
|
#endif // ENABLE_HIDPI
|
||||||
} else
|
} else
|
||||||
textRect = moveTextRect(_textRect);
|
textRect = _boundingRect;
|
||||||
|
|
||||||
if (hasHalo()) {
|
if (hasHalo()) {
|
||||||
QStaticText st(text());
|
QStaticText st(text());
|
||||||
|
Loading…
Reference in New Issue
Block a user