Changeset 846 for trunk/src/svg/qsvgnode.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/svg/qsvgnode.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 46 46 47 47 #include "qdebug.h" 48 48 49 49 50 QT_BEGIN_NAMESPACE … … 115 116 } 116 117 117 void QSvgNode::applyStyle(QPainter *p, QSvgExtraStates &states) 118 { 119 m_style.apply(p, bounds(),this, states);120 } 121 122 void QSvgNode::revertStyle(QPainter *p, QSvgExtraStates &states) 118 void QSvgNode::applyStyle(QPainter *p, QSvgExtraStates &states) 119 { 120 m_style.apply(p, this, states); 121 } 122 123 void QSvgNode::revertStyle(QPainter *p, QSvgExtraStates &states) 123 124 { 124 125 m_style.revert(p, states); … … 196 197 } 197 198 198 QRectF QSvgNode::bounds( ) const199 QRectF QSvgNode::bounds() const 199 200 { 200 201 return QRectF(0, 0, 0, 0); 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 201 231 } 202 232 … … 275 305 } 276 306 277 QRectF QSvgNode::transformedBounds(const QTransform &transform) const 278 { 279 QTransform t = transform; 280 281 QSvgTransformStyle *transStyle = m_style.transform; 282 if (transStyle) { 283 t = transStyle->qtransform() * t; 284 } 285 286 QRectF rect = bounds(); 287 288 rect = t.mapRect(rect); 289 307 QRectF QSvgNode::transformedBounds(QPainter *p, QSvgExtraStates &states) const 308 { 309 applyStyle(p, states); 310 QRectF rect = bounds(p, states); 311 revertStyle(p, states); 290 312 return rect; 291 313 } … … 311 333 } 312 334 313 qreal QSvgNode::strokeWidth() const 314 { 315 QSvgStrokeStyle *stroke = static_cast<QSvgStrokeStyle*>( 316 styleProperty(QSvgStyleProperty::STROKE)); 317 if (!stroke) 335 qreal QSvgNode::strokeWidth(QPainter *p) 336 { 337 QPen pen = p->pen(); 338 if (pen.style() == Qt::NoPen || pen.brush().style() == Qt::NoBrush || pen.isCosmetic()) 318 339 return 0; 319 if (stroke->stroke().brush().style() == Qt::NoBrush) 320 return 0; 321 return stroke->width(); 340 return pen.widthF(); 322 341 } 323 342
Note:
See TracChangeset
for help on using the changeset viewer.