MCPcopy Create free account
hub / github.com/angular-rust/ux-components / mousedown

Method mousedown

src/elements/media_query.rs:288–335  ·  view source on GitHub ↗
(&self, e: &mut MouseEvent)

Source from the content-addressed store, hash-verified

286 }
287
288 fn mousedown(&self, e: &mut MouseEvent) {
289 // self.state.borrow_mut().mouse_down = true;
290 // let component = self.component.borrow();
291 // component.onmousedown.emit(e);
292
293 // log::info!("{:?}", e);
294 // self.state.borrow_mut().mouse_down = true;
295 // let component = self.component.borrow();
296 // component.onmousedown.emit(e);
297
298 // TODO: remove this check
299 let inside = {
300 let comp = self.component.borrow();
301 Helper::in_rect(e.x as f32, e.y as f32, comp.x, comp.y, comp.w, comp.h)
302 };
303
304 // Scaffold should used as root widget after MaterialApp
305 // so all events should be inside
306 if inside {
307 let x = e.x as f32;
308 let y = e.y as f32;
309
310 if self.child.contains(x, y) {
311 self.child.mousedown(e);
312 }
313
314 // if self.title.contains(x, y) {
315 // log::info!("Is an Title");
316 // self.title.mousedown(e);
317 // }
318
319 // if self.flexible_space.contains(x, y) {
320 // // log::info!("Is an FAB");
321 // self.flexible_space.mousedown(e);
322 // }
323
324 // for action in self.actions.iter() {
325 // if action.contains(x, y) {
326 // log::info!("Is an ACTION");
327 // action.mousedown(e);
328 // }
329 // }
330 // if self.drawer.contains(x, y) {
331 // // log::info!("Is an Drawer");
332 // self.drawer.mousedown(e);
333 // }
334 }
335 }
336
337 fn mousemove(&self, e: &mut MouseEvent) {
338 let inside = Helper::in_rect(

Callers

nothing calls this directly

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected