0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

Text alignment has been fixed

This commit is contained in:
Arin Alexander 2016-03-17 11:27:09 +03:00
parent 5597089985
commit 1fcaa8121c

View File

@ -101,11 +101,11 @@ void TextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* style, Q
case Angle90: case Angle90:
hOffset = width()-fakeMarginSize(); hOffset = width()-fakeMarginSize();
vOffset = 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(); 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()); hOffset = (m_text->size().height());
} }
painter->translate(hOffset,vOffset); painter->translate(hOffset,vOffset);
@ -126,11 +126,11 @@ void TextItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* style, Q
case Angle270: case Angle270:
hOffset = fakeMarginSize(); hOffset = fakeMarginSize();
vOffset = height()-fakeMarginSize(); vOffset = height()-fakeMarginSize();
if ((tmpSize.width()>0) && (m_alignment & Qt::AlignVCenter)){ if (m_alignment & Qt::AlignVCenter){
hOffset = (width()-m_text->size().height())/2; 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()); hOffset = (width()-m_text->size().height());
} }
painter->translate(hOffset,vOffset); painter->translate(hOffset,vOffset);