summaryrefslogtreecommitdiffstats
path: root/src/svg/qsvgnode_p.h
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-03-08 16:15:44 +0100
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-03-08 17:15:53 +0100
commitea9f2aeba6f18d19d6a82b3a829373ec032af14f (patch)
treea90af7f1061a3d7623c2969bdf1f628d99045e0a /src/svg/qsvgnode_p.h
parent7b500ed543bb86429ef6fdb82b103784d6cc6a0c (diff)
Fixed bounds calculation in QtSvg.
This commit fixes an auto-test failure after fixing QTBUG-8733. The calculated element bounds should now be much tighter and respect the width of non-cosmetic pens. Task-number: QTBUG-8733 Reviewed-by: Trond
Diffstat (limited to 'src/svg/qsvgnode_p.h')
-rw-r--r--src/svg/qsvgnode_p.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/svg/qsvgnode_p.h b/src/svg/qsvgnode_p.h
index 15466f25b5..a34c7c0bf5 100644
--- a/src/svg/qsvgnode_p.h
+++ b/src/svg/qsvgnode_p.h
@@ -118,16 +118,17 @@ public:
QSvgNode *parent() const;
void appendStyleProperty(QSvgStyleProperty *prop, const QString &id);
- void applyStyle(QPainter *p, QSvgExtraStates &states);
- void revertStyle(QPainter *p, QSvgExtraStates &states);
+ void applyStyle(QPainter *p, QSvgExtraStates &states) const;
+ void revertStyle(QPainter *p, QSvgExtraStates &states) const;
QSvgStyleProperty *styleProperty(QSvgStyleProperty::Type type) const;
QSvgFillStyleProperty *styleProperty(const QString &id) const;
QSvgTinyDocument *document() const;
virtual Type type() const =0;
- virtual QRectF bounds() const;
- virtual QRectF transformedBounds(const QTransform &transform) const;
+ virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const;
+ virtual QRectF transformedBounds(QPainter *p, QSvgExtraStates &states) const;
+ QRectF transformedBounds() const;
void setRequiredFeatures(const QStringList &lst);
const QStringList & requiredFeatures() const;
@@ -156,9 +157,9 @@ public:
QString xmlClass() const;
void setXmlClass(const QString &str);
protected:
- QSvgStyle m_style;
+ mutable QSvgStyle m_style;
- qreal strokeWidth() const;
+ static qreal strokeWidth(QPainter *p);
private:
QSvgNode *m_parent;
@@ -174,6 +175,7 @@ private:
QString m_class;
DisplayMode m_displayMode;
+ mutable QRectF m_cachedBounds;
friend class QSvgTinyDocument;
};