summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvggraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/svg/qsvggraphics.cpp')
-rw-r--r--src/svg/qsvggraphics.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/svg/qsvggraphics.cpp b/src/svg/qsvggraphics.cpp
index 7740c8d..7577859 100644
--- a/src/svg/qsvggraphics.cpp
+++ b/src/svg/qsvggraphics.cpp
@@ -193,8 +193,6 @@ void QSvgLine::draw(QPainter *p, QSvgExtraStates &states)
QSvgPath::QSvgPath(QSvgNode *parent, const QPainterPath &qpath)
: QSvgNode(parent), m_path(qpath)
{
- //m_cachedBounds = m_path.controlPointRect();
- m_cachedBounds = m_path.boundingRect();
}
void QSvgPath::draw(QPainter *p, QSvgExtraStates &states)
@@ -208,8 +206,13 @@ void QSvgPath::draw(QPainter *p, QSvgExtraStates &states)
QRectF QSvgPath::bounds() const
{
qreal sw = strokeWidth();
- if (qFuzzyIsNull(sw))
+ if (qFuzzyIsNull(sw)) {
+ if (m_cachedBounds.isNull())
+ //m_cachedBounds = m_path.controlPointRect();
+ m_cachedBounds = m_path.boundingRect();
+
return m_cachedBounds;
+ }
else {
return boundsOnStroke(m_path, sw);
}