aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-06-21 21:30:29 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-06-21 21:31:19 +0200
commit3e4c0cfb7f8c8379a598dc86998e1a50ef147b28 (patch)
tree44ebb22770034b4d8b3270f969715111c92c3c3a
parente17eb1f7921caf32eb59c838505737e5c2208137 (diff)
Fix shadow offset in title editor
-rw-r--r--src/effectstack/graphicsscenerectmove.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/effectstack/graphicsscenerectmove.cpp b/src/effectstack/graphicsscenerectmove.cpp
index f124f26..0013dcb 100644
--- a/src/effectstack/graphicsscenerectmove.cpp
+++ b/src/effectstack/graphicsscenerectmove.cpp
@@ -157,7 +157,7 @@ void MyTextItem::updateShadow()
}
QFontMetrics metrics(font());
//ADJUST TO CURRENT SETTING
- int lineSpacing = data(TitleDocument::LineSpacing).toInt() + metrics.lineSpacing();
+ double lineSpacing = data(TitleDocument::LineSpacing).toInt() + metrics.lineSpacing();
QPainterPath path;
// Calculate line width
@@ -179,9 +179,7 @@ void MyTextItem::updateShadow()
path.addPath(linePath);
}
// Calculate position of text in parent item
- QRectF pathRect = QRectF(0, 0, bounding.width(), linePos - lineSpacing + metrics.descent() );
- QPointF offset = bounding.center() - pathRect.center() + QPointF(2 * m_shadowBlur, 2 * m_shadowBlur);
- path.translate(offset);
+ path.translate(QPointF(2 * m_shadowBlur, 2 * m_shadowBlur));
QRectF fullSize = bounding.united(path.boundingRect());
QImage shadow(fullSize.width() + qAbs(m_shadowOffset.x()) + 4 * m_shadowBlur, fullSize.height() + qAbs(m_shadowOffset.y()) + 4 * m_shadowBlur, QImage::Format_ARGB32_Premultiplied);
shadow.fill(Qt::transparent);