diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-11-05 13:58:43 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-11-05 14:18:11 (GMT) |
commit | 86388f7a5224da867ace47a41ed93982dfed7cfc (patch) | |
tree | 939ba67bccc3971aa890cbe8ccce711be5a4b972 /src/gui/painting/qtransform.cpp | |
parent | 0818c05f22509a4ee9310f1d313460f422d9d32b (diff) | |
download | Qt-86388f7a5224da867ace47a41ed93982dfed7cfc.zip Qt-86388f7a5224da867ace47a41ed93982dfed7cfc.tar.gz Qt-86388f7a5224da867ace47a41ed93982dfed7cfc.tar.bz2 |
Use fallback stroker for cosmetic strokes with asymetric transforms
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting/qtransform.cpp')
-rw-r--r-- | src/gui/painting/qtransform.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 8118450..1bd5842 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -2214,12 +2214,14 @@ bool qt_scaleForTransform(const QTransform &transform, qreal *scale) { const QTransform::TransformationType type = transform.type(); if (type <= QTransform::TxTranslate) { - *scale = 1; + if (scale) + *scale = 1; return true; } else if (type == QTransform::TxScale) { const qreal xScale = qAbs(transform.m11()); const qreal yScale = qAbs(transform.m22()); - *scale = qMax(xScale, yScale); + if (scale) + *scale = qMax(xScale, yScale); return qFuzzyCompare(xScale, yScale); } @@ -2227,7 +2229,8 @@ bool qt_scaleForTransform(const QTransform &transform, qreal *scale) + transform.m21() * transform.m21(); const qreal yScale = transform.m12() * transform.m12() + transform.m22() * transform.m22(); - *scale = qSqrt(qMax(xScale, yScale)); + if (scale) + *scale = qSqrt(qMax(xScale, yScale)); return type == QTransform::TxRotate && qFuzzyCompare(xScale, yScale); } |