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

Method relayout

src/elements/scaffold.rs:513–543  ·  view source on GitHub ↗
(&self, origin: Point2<f32>)

Source from the content-addressed store, hash-verified

511 }
512
513 fn relayout(&self, origin: Point2<f32>) {
514 let update_childs = match LayoutSystem::layout(self.node) {
515 Ok(layout) => {
516 let mut comp = self.as_ref().borrow_mut();
517 comp.x = layout.location.x + origin.x;
518 comp.y = layout.location.y + origin.y;
519 comp.w = layout.size.width;
520 comp.h = layout.size.height;
521 true
522 }
523 Err(e) => {
524 log::error!("{}", e);
525 false
526 }
527 };
528
529 if update_childs {
530 let comp = self.as_ref().borrow();
531 let origin = Point2 {
532 x: comp.x,
533 y: comp.y,
534 };
535
536 self.app_bar.relayout(origin);
537 self.body.relayout(origin);
538 self.floating_action_button.relayout(origin);
539 self.end_drawer.relayout(origin);
540 self.bottom_navigation_bar.relayout(origin);
541 self.bottom_sheet.relayout(origin);
542 }
543 }
544
545 fn update(&self, dt: f32) {
546 log::info!("Update Scaffolld");

Callers

nothing calls this directly

Calls 1

as_refMethod · 0.45

Tested by

no test coverage detected