Skip to content

Commit

Permalink
metal: don't apply transformation matrix to unaccelerated deltas
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Jul 19, 2024
1 parent 9dc5812 commit df02fcf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/backends/metal/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,24 +227,18 @@ impl MetalBackend {
let (event, dev) = unpack!(self, event, pointer_event);
let mut dx = event.dx();
let mut dy = event.dy();
let mut dx_unaccelerated = event.dx_unaccelerated();
let mut dy_unaccelerated = event.dy_unaccelerated();
if let Some(matrix) = dev.transform_matrix.get() {
(dx, dy) = (
matrix[0][0] * dx + matrix[0][1] * dy,
matrix[1][0] * dx + matrix[1][1] * dy,
);
(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 {
time_usec: event.time_usec(),
dx: Fixed::from_f64(dx),
dy: Fixed::from_f64(dy),
dx_unaccelerated: Fixed::from_f64(dx_unaccelerated),
dy_unaccelerated: Fixed::from_f64(dy_unaccelerated),
dx_unaccelerated: Fixed::from_f64(event.dx_unaccelerated()),
dy_unaccelerated: Fixed::from_f64(event.dy_unaccelerated()),
});
}

Expand Down

0 comments on commit df02fcf

Please sign in to comment.