Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/svg/qsvgnode.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4646
    4747#include "qdebug.h"
     48
    4849
    4950QT_BEGIN_NAMESPACE
     
    115116}
    116117
    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)
     118void QSvgNode::applyStyle(QPainter *p, QSvgExtraStates &states)
     119{
     120    m_style.apply(p, this, states);
     121}
     122
     123void QSvgNode::revertStyle(QPainter *p, QSvgExtraStates &states)
    123124{
    124125    m_style.revert(p, states);
     
    196197}
    197198
    198 QRectF QSvgNode::bounds() const
     199QRectF QSvgNode::bounds() const
    199200{
    200201    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
    201231}
    202232
     
    275305}
    276306
    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 
     307QRectF QSvgNode::transformedBounds(QPainter *p, QSvgExtraStates &states) const
     308{
     309    applyStyle(p, states);
     310    QRectF rect = bounds(p, states);
     311    revertStyle(p, states);
    290312    return rect;
    291313}
     
    311333}
    312334
    313 qreal QSvgNode::strokeWidth() const
    314 {
    315     QSvgStrokeStyle *stroke = static_cast<QSvgStrokeStyle*>(
    316         styleProperty(QSvgStyleProperty::STROKE));
    317     if (!stroke)
     335qreal QSvgNode::strokeWidth(QPainter *p)
     336{
     337    QPen pen = p->pen();
     338    if (pen.style() == Qt::NoPen || pen.brush().style() == Qt::NoBrush || pen.isCosmetic())
    318339        return 0;
    319     if (stroke->stroke().brush().style() == Qt::NoBrush)
    320         return 0;
    321     return stroke->width();
     340    return pen.widthF();
    322341}
    323342
Note: See TracChangeset for help on using the changeset viewer.