summaryrefslogtreecommitdiffstats
path: root/src/svg
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-31 12:06:52 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-31 12:06:52 +0200
commitae88ef4063548816efd4371920deeb4d87ea98f4 (patch)
treeb820fbd5840c074325f328b6fa5332b6603316cc /src/svg
parent2991e45683d02660294f34d074ef3366d0f62a73 (diff)
parentf2dbfdccfab0648cf353ef56ced269468984840c (diff)
Merge branch '4.6' of git:qt/qt into 4.6
Diffstat (limited to 'src/svg')
-rw-r--r--src/svg/qsvggraphics.cpp9
-rw-r--r--src/svg/qsvggraphics_p.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/svg/qsvggraphics.cpp b/src/svg/qsvggraphics.cpp
index 7740c8d43b..7577859f4e 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);
}
diff --git a/src/svg/qsvggraphics_p.h b/src/svg/qsvggraphics_p.h
index 584a1a15a7..67232e5af1 100644
--- a/src/svg/qsvggraphics_p.h
+++ b/src/svg/qsvggraphics_p.h
@@ -145,7 +145,7 @@ public:
}
private:
QPainterPath m_path;
- QRectF m_cachedBounds;
+ mutable QRectF m_cachedBounds;
};
class QSvgPolygon : public QSvgNode