diff options
author | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-04-07 14:50:23 (GMT) |
---|---|---|
committer | Bjoern Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-04-08 08:24:38 (GMT) |
commit | 72f84ad17d0905f91e9d3988bb0f6482df6c6c78 (patch) | |
tree | fa1c345ee0d052db81733659f9fcdc161ede0b95 /src/svg | |
parent | 6fd4a720870775a4d9a645d9000b0259caa74178 (diff) | |
download | Qt-72f84ad17d0905f91e9d3988bb0f6482df6c6c78.zip Qt-72f84ad17d0905f91e9d3988bb0f6482df6c6c78.tar.gz Qt-72f84ad17d0905f91e9d3988bb0f6482df6c6c78.tar.bz2 |
Use qIsFuzzyNull rather than the more expensive qFuzzyCompare
See also fde7f3d03782c801901f511131458d6fcb1021a5
Reviewed-by: Olivier
Reviewed-by: Samuel
Diffstat (limited to 'src/svg')
-rw-r--r-- | src/svg/qgraphicssvgitem.cpp | 2 | ||||
-rw-r--r-- | src/svg/qsvggenerator.cpp | 2 | ||||
-rw-r--r-- | src/svg/qsvggraphics.cpp | 16 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/svg/qgraphicssvgitem.cpp b/src/svg/qgraphicssvgitem.cpp index e17df03..5c8a3c0 100644 --- a/src/svg/qgraphicssvgitem.cpp +++ b/src/svg/qgraphicssvgitem.cpp @@ -186,7 +186,7 @@ static void qt_graphicsItem_highlightSelected( QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option) { const QRectF murect = painter->transform().mapRect(QRectF(0, 0, 1, 1)); - if (qFuzzyCompare(qMax(murect.width(), murect.height()) + 1, 1)) + if (qIsFuzzyNull(qMax(murect.width(), murect.height()))) return; const QRectF mbrect = painter->transform().mapRect(item->boundingRect()); diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index e822da5..7c8926d 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -971,7 +971,7 @@ void QSvgPaintEngine::updateState(const QPaintEngineState &state) } if (flags & QPaintEngine::DirtyOpacity) { - if (!qFuzzyCompare(state.opacity(), 1)) + if (!qIsFuzzyNull(state.opacity() - 1)) stream() << "opacity=\""<<state.opacity()<<"\" "; } diff --git a/src/svg/qsvggraphics.cpp b/src/svg/qsvggraphics.cpp index 9ff9c26..709a2f7 100644 --- a/src/svg/qsvggraphics.cpp +++ b/src/svg/qsvggraphics.cpp @@ -94,7 +94,7 @@ QSvgCircle::QSvgCircle(QSvgNode *parent, const QRectF &rect) QRectF QSvgCircle::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_bounds; else { QPainterPath path; @@ -129,7 +129,7 @@ QSvgEllipse::QSvgEllipse(QSvgNode *parent, const QRectF &rect) QRectF QSvgEllipse::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_bounds; else { QPainterPath path; @@ -190,7 +190,7 @@ void QSvgPath::draw(QPainter *p, QSvgExtraStates &states) QRectF QSvgPath::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_cachedBounds; else { return boundsOnStroke(m_path, sw); @@ -206,7 +206,7 @@ QSvgPolygon::QSvgPolygon(QSvgNode *parent, const QPolygonF &poly) QRectF QSvgPolygon::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_poly.boundingRect(); else { QPainterPath path; @@ -249,7 +249,7 @@ QSvgRect::QSvgRect(QSvgNode *node, const QRectF &rect, int rx, int ry) QRectF QSvgRect::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_rect; else { QPainterPath path; @@ -596,7 +596,7 @@ QRectF QSvgUse::transformedBounds(const QTransform &transform) const QRectF QSvgPolyline::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_poly.boundingRect(); else { QPainterPath path; @@ -608,7 +608,7 @@ QRectF QSvgPolyline::bounds() const QRectF QSvgArc::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) + if (qIsFuzzyNull(sw)) return m_cachedBounds; else { return boundsOnStroke(cubic, sw); @@ -623,7 +623,7 @@ QRectF QSvgImage::bounds() const QRectF QSvgLine::bounds() const { qreal sw = strokeWidth(); - if (qFuzzyCompare(sw + 1, 1)) { + if (qIsFuzzyNull(sw)) { qreal minX = qMin(m_bounds.x1(), m_bounds.x2()); qreal minY = qMin(m_bounds.y1(), m_bounds.y2()); qreal maxX = qMax(m_bounds.x1(), m_bounds.x2()); |