Touch
(&mut self, index: usize, x: f64, y: f64, active: bool)
| 229 | |
| 230 | // Touch |
| 231 | pub fn set_touch(&mut self, index: usize, x: f64, y: f64, active: bool) { |
| 232 | if index < MAX_TOUCH_POINTS { |
| 233 | self.touch_points[index] = TouchPoint { x, y, active }; |
| 234 | if active { |
| 235 | self.touch_pending_release[index] = false; |
| 236 | } |
| 237 | self.touch_count = self.touch_points.iter().filter(|t| t.active).count(); |
| 238 | } |
| 239 | } |
| 240 | /// Deferred release: keeps the slot active for the current frame and |
| 241 | /// clears it at `end_frame`. Call from platform event loops on ACTION_UP |
| 242 | /// so a DOWN+UP that falls inside one frame remains visible to the game. |
no test coverage detected