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

Method set_size

src/elements/scaffold.rs:481–511  ·  view source on GitHub ↗
(&self, w: f32, h: f32)

Source from the content-addressed store, hash-verified

479 }
480
481 fn set_size(&self, w: f32, h: f32) {
482 log::info!("Set Size ScaffoldElement {}x{}", w, h);
483
484 let (dw, dh) = {
485 let mut comp = self.as_ref().borrow_mut();
486
487 assert!(
488 !comp.destroyed,
489 "Widget was already destroyed but is being interacted with"
490 );
491
492 comp.updating = true;
493
494 let dw = w - comp.w;
495 let dh = h - comp.h;
496
497 comp.w = w;
498 comp.h = h;
499
500 comp.updating = false;
501
502 (dw, dh)
503 };
504
505 self.bounds_changed(0.0, 0.0, dw, dh);
506
507 // self.app_bar.set_w(w);
508 // self.body.set_w(w);
509 // self.bottom_navigation_bar.set_w(w);
510 // self.bottom_sheet.set_w(w);
511 }
512
513 fn relayout(&self, origin: Point2<f32>) {
514 let update_childs = match LayoutSystem::layout(self.node) {

Callers 5

resizedMethod · 0.45
newMethod · 0.45
mousemoveMethod · 0.45
bounds_changedMethod · 0.45
bounds_changedMethod · 0.45

Calls 2

as_refMethod · 0.45
bounds_changedMethod · 0.45

Tested by

no test coverage detected