summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorgunnar <gunnar@trolltech.com>2009-11-04 20:02:10 (GMT)
committergunnar <gunnar@trolltech.com>2009-11-04 20:13:01 (GMT)
commit1a71e4b7960ba27fe6d47815da9337020085ac16 (patch)
treee3f5edaae24cefd507856de1cf8d7496c8a6eab7 /src/gui/painting
parent391441b2ce2be527db0829798631436670df0965 (diff)
downloadQt-1a71e4b7960ba27fe6d47815da9337020085ac16.zip
Qt-1a71e4b7960ba27fe6d47815da9337020085ac16.tar.gz
Qt-1a71e4b7960ba27fe6d47815da9337020085ac16.tar.bz2
Made QPen== catch QPen(Qt::NoPen) == QPen(QBrush(Qt::NoBrush))
QSvgDocument uses the latter as default pen so every svg filling command would issue a penChange without this. Reviewed-by: TrustMe
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpen.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 9746747..1ddadf2 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -835,16 +835,19 @@ bool QPen::operator==(const QPen &p) const
{
QPenData *dd = static_cast<QPenData *>(d);
QPenData *pdd = static_cast<QPenData *>(p.d);
- return (p.d == d) || (p.d->style == d->style
- && p.d->capStyle == d->capStyle
- && p.d->joinStyle == d->joinStyle
- && p.d->width == d->width
- && pdd->miterLimit == dd->miterLimit
- && (d->style != Qt::CustomDashLine
- || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) &&
- pdd->dashPattern == dd->dashPattern))
- && p.d->brush == d->brush
- && pdd->cosmetic == dd->cosmetic);
+ return (p.d == d)
+ || (p.d->style == d->style
+ && p.d->capStyle == d->capStyle
+ && p.d->joinStyle == d->joinStyle
+ && p.d->width == d->width
+ && pdd->miterLimit == dd->miterLimit
+ && (d->style != Qt::CustomDashLine
+ || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) &&
+ pdd->dashPattern == dd->dashPattern))
+ && p.d->brush == d->brush
+ && pdd->cosmetic == dd->cosmetic)
+ || ((p.d->style == Qt::NoPen || p.d->brush.style() == Qt::NoBrush)
+ && (d->style == Qt::NoPen || d->brush.style() == Qt::NoBrush));
}