metal: fix application of transform matrix
This commit is contained in:
parent
3d4af09f99
commit
8cd28dd3bf
1 changed files with 8 additions and 4 deletions
|
|
@ -192,10 +192,14 @@ impl MetalBackend {
|
||||||
let mut dx_unaccelerated = event.dx_unaccelerated();
|
let mut dx_unaccelerated = event.dx_unaccelerated();
|
||||||
let mut dy_unaccelerated = event.dy_unaccelerated();
|
let mut dy_unaccelerated = event.dy_unaccelerated();
|
||||||
if let Some(matrix) = dev.transform_matrix.get() {
|
if let Some(matrix) = dev.transform_matrix.get() {
|
||||||
dx = matrix[0][0] * dx + matrix[0][1] * dy;
|
(dx, dy) = (
|
||||||
dy = matrix[1][0] * dx + matrix[1][1] * dy;
|
matrix[0][0] * dx + matrix[0][1] * dy,
|
||||||
dx_unaccelerated = matrix[0][0] * dx_unaccelerated + matrix[0][1] * dy_unaccelerated;
|
matrix[1][0] * dx + matrix[1][1] * dy,
|
||||||
dy_unaccelerated = matrix[1][0] * dx_unaccelerated + matrix[1][1] * dy_unaccelerated;
|
);
|
||||||
|
(dx_unaccelerated, dy_unaccelerated) = (
|
||||||
|
matrix[0][0] * dx_unaccelerated + matrix[0][1] * dy_unaccelerated,
|
||||||
|
matrix[1][0] * dx_unaccelerated + matrix[1][1] * dy_unaccelerated,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
dev.event(InputEvent::Motion {
|
dev.event(InputEvent::Motion {
|
||||||
time_usec: event.time_usec(),
|
time_usec: event.time_usec(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue