mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
assume scale argument is not null in qt_scaleForTransform()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e5cbe2e47e
commit
16c05a6d9a
1 changed files with 4 additions and 6 deletions
|
@ -1531,15 +1531,14 @@ static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transfor
|
|||
Q_GUI_EXPORT
|
||||
bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
|
||||
{
|
||||
Q_ASSERT(scale);
|
||||
const QTransform::TransformationType type = transform.type();
|
||||
if (type <= QTransform::TxTranslate) {
|
||||
if (scale)
|
||||
*scale = 1;
|
||||
return true;
|
||||
} else if (type == QTransform::TxScale) {
|
||||
const qreal xScale = qAbs(transform.m11());
|
||||
const qreal yScale = qAbs(transform.m22());
|
||||
if (scale)
|
||||
*scale = qMax(xScale, yScale);
|
||||
return qFuzzyCompare(xScale, yScale);
|
||||
}
|
||||
|
@ -1548,7 +1547,6 @@ bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
|
|||
+ transform.m21() * transform.m21();
|
||||
const qreal yScale = transform.m12() * transform.m12()
|
||||
+ transform.m22() * transform.m22();
|
||||
if (scale)
|
||||
*scale = qSqrt(qMax(xScale, yScale));
|
||||
return type == QTransform::TxRotate && qFuzzyCompare(xScale, yScale);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue