aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/matrix.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
committercrupest <crupest@outlook.com>2019-12-12 19:53:17 +0800
commite69911a8b161b81ce3f7b209175766da2b7b3d4b (patch)
tree76b1f4b6f9f5ad6111578771be783ee456aeb912 /include/cru/platform/matrix.hpp
parent154b5b838edfdcef93cd0a33c013ad7f5f9d7337 (diff)
downloadcru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.gz
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.tar.bz2
cru-e69911a8b161b81ce3f7b209175766da2b7b3d4b.zip
...
Diffstat (limited to 'include/cru/platform/matrix.hpp')
-rw-r--r--include/cru/platform/matrix.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/cru/platform/matrix.hpp b/include/cru/platform/matrix.hpp
index cbb55c78..030e1378 100644
--- a/include/cru/platform/matrix.hpp
+++ b/include/cru/platform/matrix.hpp
@@ -1,5 +1,5 @@
#pragma once
-#include "graphic_base.hpp"
+#include "graph_base.hpp"
#include <cmath>
@@ -39,7 +39,7 @@ struct Matrix {
Point TransformPoint(const Point& point) const {
return Point{point.x * m11 + point.y * m21 + m31,
- point.x * m12 + point.y * m22 + m32};
+ point.x * m12 + point.y * m22 + m32};
}
static Matrix Identity() {
@@ -50,10 +50,8 @@ struct Matrix {
return Matrix{1.0f, 0.0f, 0.0f, 1.0f, x, y};
}
- static Matrix Scale(float sx, float sy) { return Scale(sx, sy, 0.0f, 0.0f); }
-
- static Matrix Scale(float sx, float sy, float cx, float cy) {
- return Matrix{sx, 0.0f, 0.0f, sy, cx - sx * cx, cy - sy * cy};
+ static Matrix Scale(float sx, float sy) {
+ return Matrix{sx, 0.0f, 0.0f, sy, 0.0f, 0.0f};
}
static Matrix Rotation(float angle) {