From 1fcaa8121cd28d9d203cad10cf4100724dcd9423 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 17 Mar 2016 11:27:09 +0300 Subject: [PATCH] Text alignment has been fixed --- src/items/lrtextitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/items/lrtextitem.cpp b/src/items/lrtextitem.cpp index 21094fd..a2b558b 100644 --- a/src/items/lrtextitem.cpp +++ b/src/items/lrtextitem.cpp @@ -101,11 +101,11 @@ void TextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* style, Q case Angle90: hOffset = width()-fakeMarginSize(); vOffset = fakeMarginSize(); - if ((tmpSize.width()>0) && (m_alignment & Qt::AlignVCenter)){ + if (m_alignment & Qt::AlignVCenter){ hOffset = (width()-m_text->size().height())/2+m_text->size().height(); } - if ((tmpSize.height()>0) && (m_alignment & Qt::AlignBottom)){ + if (m_alignment & Qt::AlignBottom){ hOffset = (m_text->size().height()); } painter->translate(hOffset,vOffset); @@ -126,11 +126,11 @@ void TextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* style, Q case Angle270: hOffset = fakeMarginSize(); vOffset = height()-fakeMarginSize(); - if ((tmpSize.width()>0) && (m_alignment & Qt::AlignVCenter)){ + if (m_alignment & Qt::AlignVCenter){ hOffset = (width()-m_text->size().height())/2; } - if ((tmpSize.height()>0) && (m_alignment & Qt::AlignBottom)){ + if (m_alignment & Qt::AlignBottom){ hOffset = (width()-m_text->size().height()); } painter->translate(hOffset,vOffset);