Skip to content

Commit 34d8fd7

Browse files
committed
Use the correct float type for gesture events
1 parent 96c32cf commit 34d8fd7

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

src/sdl2/event.rs

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ pub enum Event {
186186
FingerMotion(u32, i64, i64, f32, f32, f32, f32, f32),
187187

188188
/// (timestamp, touchId, gestureId, numFingers, error, x, y)
189-
DollarGesture(u32, i64, i64, u32, f64, f64, f64),
190-
DollarRecord(u32, i64, i64, u32, f64, f64, f64),
189+
DollarGesture(u32, i64, i64, u32, f32, f32, f32),
190+
DollarRecord(u32, i64, i64, u32, f32, f32, f32),
191191
/// (timestamp, touchId, dTheta, dDist, x, y, numFingers)
192-
MultiGesture(u32, i64, f64, f64, f64, f64, u16),
192+
MultiGesture(u32, i64, f32, f32, f32, f32, u16),
193193

194194
/// (timestamp)
195195
ClipboardUpdate(u32),
@@ -542,28 +542,21 @@ impl Event {
542542
}
543543
EventType::DollarGesture => {
544544
let ref event = *raw.dgesture();
545-
Event::DollarGesture(event.timestamp,
546-
event.touchId as i64,
547-
event.gestureId as i64,
548-
event.numFingers,
549-
event.error as f64, event.x as f64,
550-
event.y as f64)
545+
Event::DollarGesture(event.timestamp, event.touchId,
546+
event.gestureId, event.numFingers,
547+
event.error, event.x, event.y)
551548
}
552549
EventType::DollarRecord => {
553550
let ref event = *raw.dgesture();
554-
Event::DollarRecord(event.timestamp,
555-
event.touchId as i64,
556-
event.gestureId as i64,
557-
event.numFingers,
558-
event.error as f64, event.x as f64,
559-
event.y as f64)
551+
Event::DollarRecord(event.timestamp, event.touchId,
552+
event.gestureId, event.numFingers,
553+
event.error, event.x, event.y)
560554
}
561555
EventType::MultiGesture => {
562556
let ref event = *raw.mgesture();
563-
Event::MultiGesture(event.timestamp,
564-
event.touchId as i64, event.dTheta as f64,
565-
event.dDist as f64, event.x as f64,
566-
event.y as f64, event.numFingers)
557+
Event::MultiGesture(event.timestamp, event.touchId,
558+
event.dTheta, event.dDist,
559+
event.x, event.y, event.numFingers)
567560
}
568561

569562
EventType::ClipboardUpdate => {

0 commit comments

Comments
 (0)