add touches_changed and target_touches
This commit is contained in:
1 parent
c10700c962
commit
27f4b3f345
2 files changed
+121
-2
No files matched your search
@@ -194,6 +194,26 @@ impl crate::events::HasTouchData for TouchEvent {
|
||||
result
|
||||
}
|
||||
|
||||
fn touches_changed(&self) -> Vec<TouchPoint> {
|
||||
let touches = self.changed_touches();
|
||||
let mut result = Vec::with_capacity(touches.length() as usize);
|
||||
for i in 0..touches.length() {
|
||||
let touch = touches.get(i).unwrap();
|
||||
result.push(TouchPoint::new(touch));
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn target_touches(&self) -> Vec<TouchPoint> {
|
||||
let touches = self.target_touches();
|
||||
let mut result = Vec::with_capacity(touches.length() as usize);
|
||||
for i in 0..touches.length() {
|
||||
let touch = touches.get(i).unwrap();
|
||||
result.push(TouchPoint::new(touch));
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn std::any::Any {
|
||||
self
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user