projects
/
platform
/
upstream
/
libinput.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0f6711
)
util: make a float to int conversion explicit
author
Peter Hutterer
<peter.hutterer@who-t.net>
Wed, 19 Jun 2024 23:50:15 +0000
(09:50 +1000)
committer
Peter Hutterer
<peter.hutterer@who-t.net>
Tue, 29 Oct 2024 00:18:54 +0000
(10:18 +1000)
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1071>
src/util-matrix.h
patch
|
blob
|
history
diff --git
a/src/util-matrix.h
b/src/util-matrix.h
index 09ac99e40f4a6ac1629b21a0fb563ba554533c93..6a09803ddf3adb4eb1445c832f060c9b56f167ab 100644
(file)
--- a/
src/util-matrix.h
+++ b/
src/util-matrix.h
@@
-136,13
+136,13
@@
matrix_mult(struct matrix *dest,
static inline void
matrix_mult_vec(const struct matrix *m, int *x, int *y)
{
-
in
t tx, ty;
+
floa
t tx, ty;
tx = *x * m->val[0][0] + *y * m->val[0][1] + m->val[0][2];
ty = *x * m->val[1][0] + *y * m->val[1][1] + m->val[1][2];
- *x = tx;
- *y = ty;
+ *x =
(int)
tx;
+ *y =
(int)
ty;
}
static inline void