| 327 | } |
| 328 | |
| 329 | fn mousedown(&self, e: &mut MouseEvent) { |
| 330 | // self.state.borrow_mut().mouse_down = true; |
| 331 | // let component = self.component.borrow(); |
| 332 | // component.onmousedown.emit(e); |
| 333 | |
| 334 | // log::info!("{:?}", e); |
| 335 | // self.state.borrow_mut().mouse_down = true; |
| 336 | // let component = self.component.borrow(); |
| 337 | // component.onmousedown.emit(e); |
| 338 | |
| 339 | // TODO: remove this check |
| 340 | let inside = { |
| 341 | let comp = self.component.borrow(); |
| 342 | Helper::in_rect(e.x as f32, e.y as f32, comp.x, comp.y, comp.w, comp.h) |
| 343 | }; |
| 344 | |
| 345 | // Scaffold should used as root widget after MaterialApp |
| 346 | // so all events should be inside |
| 347 | if inside { |
| 348 | let x = e.x as f32; |
| 349 | let y = e.y as f32; |
| 350 | |
| 351 | // if self.title.contains(x, y) { |
| 352 | // log::info!("Is an Title"); |
| 353 | // self.title.mousedown(e); |
| 354 | // } |
| 355 | |
| 356 | // if self.flexible_space.contains(x, y) { |
| 357 | // // log::info!("Is an FAB"); |
| 358 | // self.flexible_space.mousedown(e); |
| 359 | // } |
| 360 | |
| 361 | for child in self.children.iter() { |
| 362 | if child.contains(x, y) { |
| 363 | child.mousedown(e); |
| 364 | } |
| 365 | } |
| 366 | // if self.drawer.contains(x, y) { |
| 367 | // // log::info!("Is an Drawer"); |
| 368 | // self.drawer.mousedown(e); |
| 369 | // } |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | fn mousemove(&self, e: &mut MouseEvent) { |
| 374 | let inside = Helper::in_rect( |