diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-09 09:25:27 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-12-09 09:25:27 +0400 |
| commit | d9e27988a7cecfe80156bea76119c9c15171fc52 (patch) | |
| tree | 92b43f8a7e6402c26c5d72aa064d87343de2c75b /src | |
| parent | 1be860c5273c1c97bf445118cdede2d1116330b0 (diff) | |
| download | niri-d9e27988a7cecfe80156bea76119c9c15171fc52.tar.gz niri-d9e27988a7cecfe80156bea76119c9c15171fc52.tar.bz2 niri-d9e27988a7cecfe80156bea76119c9c15171fc52.zip | |
Extract tablet data variables
Diffstat (limited to 'src')
| -rw-r--r-- | src/input.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/input.rs b/src/input.rs index 15630b76..3b7e4dab 100644 --- a/src/input.rs +++ b/src/input.rs @@ -100,12 +100,9 @@ impl State { if device.has_capability(input::DeviceCapability::TabletTool) { match device.size() { Some((w, h)) => { - self.niri.tablets.insert( - device.clone(), - TabletData { - aspect_ratio: w / h, - }, - ); + let aspect_ratio = w / h; + let data = TabletData { aspect_ratio }; + self.niri.tablets.insert(device.clone(), data); } None => { warn!("tablet tool device has no size"); |
