Skip to content

Commit 8cf2ca1

Browse files
committed
math: include cstring for memset
fixup name too
1 parent fabc30d commit 8cf2ca1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/helpers/math/Math.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "Math.hpp"
22
#include <unordered_map>
3+
#include <cstring>
34

45
Hyprutils::Math::eTransform wlTransformToHyprutils(wl_output_transform t) {
56
switch (t) {
@@ -52,21 +53,21 @@ static void matrixTranslate(float mat[9], float x, float y) {
5253
float translate[9] = {
5354
1.0f, 0.0f, x, 0.0f, 1.0f, y, 0.0f, 0.0f, 1.0f,
5455
};
55-
wlr_matrix_multiply(mat, mat, translate);
56+
matrixMultiply(mat, mat, translate);
5657
}
5758

5859
static void matrixScale(float mat[9], float x, float y) {
5960
float scale[9] = {
6061
x, 0.0f, 0.0f, 0.0f, y, 0.0f, 0.0f, 0.0f, 1.0f,
6162
};
62-
wlr_matrix_multiply(mat, mat, scale);
63+
matrixMultiply(mat, mat, scale);
6364
}
6465

6566
static void matrixRotate(float mat[9], float rad) {
6667
float rotate[9] = {
6768
cos(rad), -sin(rad), 0.0f, sin(rad), cos(rad), 0.0f, 0.0f, 0.0f, 1.0f,
6869
};
69-
wlr_matrix_multiply(mat, mat, rotate);
70+
matrixMultiply(mat, mat, rotate);
7071
}
7172

7273
static std::unordered_map<eTransform, std::array<float, 9>> transforms = {
@@ -208,7 +209,7 @@ void projectBox(float mat[9], CBox& box, eTransform transform, float rotation, c
208209
matrixTranslate(mat, -width / 2, -height / 2);
209210
}
210211

211-
wlr_matrix_scale(mat, width, height);
212+
matrixScale(mat, width, height);
212213

213214
if (transform != HYPRUTILS_TRANSFORM_NORMAL) {
214215
matrixTranslate(mat, 0.5, 0.5);

0 commit comments

Comments
 (0)