Skip to content

Commit

Permalink
input: Apply output transform to touch/tablet events
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Dec 2, 2024
1 parent 5ed0723 commit b160860
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2146,10 +2146,14 @@ where
B::Device: 'static,
{
let geometry = output.geometry();
event
.position_transformed(geometry.size.as_logical())
.as_global()
+ geometry.loc.to_f64()
let transform = output.current_transform();
let size = transform
.invert()
.transform_size(geometry.size.as_logical());
geometry.loc.to_f64()
+ transform
.transform_point_in(event.position_transformed(size), &size.to_f64())
.as_global()
}

// TODO Is it possible to determine mapping for external touchscreen?
Expand Down

0 comments on commit b160860

Please sign in to comment.