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

Method relayout

src/elements/fitted_box.rs:444–468  ·  view source on GitHub ↗
(&self, origin: Point2<f32>)

Source from the content-addressed store, hash-verified

442 }
443
444 fn relayout(&self, origin: Point2<f32>) {
445 let update_childs = match LayoutSystem::layout(self.node) {
446 Ok(layout) => {
447 let mut comp = self.as_ref().borrow_mut();
448 comp.x = layout.location.x + origin.x;
449 comp.y = layout.location.y + origin.y;
450 comp.w = layout.size.width;
451 comp.h = layout.size.height;
452
453 true
454 }
455 Err(e) => {
456 log::error!("{}", e);
457 false
458 }
459 };
460
461 if update_childs {
462 let comp = self.as_ref().borrow();
463 self.child.relayout(Point2 {
464 x: comp.x,
465 y: comp.y,
466 });
467 }
468 }
469}

Callers

nothing calls this directly

Calls 1

as_refMethod · 0.45

Tested by

no test coverage detected