summaryrefslogtreecommitdiffstats log msg author committer range
path: root/src/gui/math3d/qmatrix4x4.h
diff options
 context: 12345678910152025303540 space: includeignore mode: unifiedssdiffstat only
Diffstat (limited to 'src/gui/math3d/qmatrix4x4.h')
-rw-r--r--src/gui/math3d/qmatrix4x4.h42
1 files changed, 22 insertions, 20 deletions
 diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.hindex 19540308a1..e143884f9d 100644--- a/src/gui/math3d/qmatrix4x4.h+++ b/src/gui/math3d/qmatrix4x4.h@@ -867,9 +867,9 @@ inline QPointF operator*(const QPointF& point, const QMatrix4x4& matrix) yin * matrix.m[3][1] + matrix.m[3][3]; if (w == 1.0f) {- return QPointF(float(x), float(y));+ return QPointF(qreal(x), qreal(y)); } else {- return QPointF(float(x / w), float(y / w));+ return QPointF(qreal(x / w), qreal(y / w)); } } @@ -907,33 +907,35 @@ inline QPoint operator*(const QMatrix4x4& matrix, const QPoint& point) inline QPointF operator*(const QMatrix4x4& matrix, const QPointF& point) {- float xin, yin;- float x, y, w;+ qreal xin, yin;+ qreal x, y, w; xin = point.x(); yin = point.y(); if (matrix.flagBits == QMatrix4x4::Identity) { return point; } else if (matrix.flagBits < QMatrix4x4::Rotation2D) { // Translation | Scale- return QPointF(xin * matrix.m[0][0] + matrix.m[3][0],- yin * matrix.m[1][1] + matrix.m[3][1]);+ return QPointF(xin * qreal(matrix.m[0][0]) + qreal(matrix.m[3][0]),+ yin * qreal(matrix.m[1][1]) + qreal(matrix.m[3][1])); } else if (matrix.flagBits < QMatrix4x4::Perspective) {- return QPointF(xin * matrix.m[0][0] + yin * matrix.m[1][0] + matrix.m[3][0],- xin * matrix.m[0][1] + yin * matrix.m[1][1] + matrix.m[3][1]);+ return QPointF(xin * qreal(matrix.m[0][0]) + yin * qreal(matrix.m[1][0]) ++ qreal(matrix.m[3][0]),+ xin * qreal(matrix.m[0][1]) + yin * qreal(matrix.m[1][1]) ++ qreal(matrix.m[3][1])); } else {- x = xin * matrix.m[0][0] +- yin * matrix.m[1][0] +- matrix.m[3][0];- y = xin * matrix.m[0][1] +- yin * matrix.m[1][1] +- matrix.m[3][1];- w = xin * matrix.m[0][3] +- yin * matrix.m[1][3] +- matrix.m[3][3];- if (w == 1.0f) {- return QPointF(float(x), float(y));+ x = xin * qreal(matrix.m[0][0]) ++ yin * qreal(matrix.m[1][0]) ++ qreal(matrix.m[3][0]);+ y = xin * qreal(matrix.m[0][1]) ++ yin * qreal(matrix.m[1][1]) ++ qreal(matrix.m[3][1]);+ w = xin * qreal(matrix.m[0][3]) ++ yin * qreal(matrix.m[1][3]) ++ qreal(matrix.m[3][3]);+ if (w == 1.0) {+ return QPointF(qreal(x), qreal(y)); } else {- return QPointF(float(x / w), float(y / w));+ return QPointF(qreal(x / w), qreal(y / w)); } } }