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

Method set_clip

src/elements/element.rs:402–442  ·  view source on GitHub ↗

The control this one is clipped by

(&self, other: Option<Id>)

Source from the content-addressed store, hash-verified

400
401 /// The control this one is clipped by
402 fn set_clip(&self, other: Option<Id>) {
403 let mut comp = self.as_ref().borrow_mut();
404
405 assert!(
406 !comp.destroyed,
407 "Widget was already destroyed but is being interacted with"
408 );
409
410 // if let Some(clip) = comp.clip {
411 // if let Some(widget) = clip.widget() {
412 // // widget.onbounds.remove(box || self.onclipchanged());
413 // todo!()
414 // }
415 // }
416
417 comp.clip = other;
418
419 if let Some(clip) = comp.clip {
420 // if let Some(widget) = clip.widget() {
421 // // widget.onbounds.listen(box |e| self.onclipchanged());
422 // todo!()
423 // }
424
425 // // TODO: clip children applies to children
426 // for child in comp.children.iter() {
427 // if let Some(widget) = child.widget() {
428 // widget.set_clip(comp.clip);
429 // }
430 // }
431
432 // self.onclipchanged();
433 } else if comp.onclip.is_some() {
434 let _ = comp.onclip.get().try_send(WidgetClipEvent {
435 clipped: true,
436 h: 0.0,
437 w: 0.0,
438 x: 0.0,
439 y: 0.0,
440 });
441 }
442 }
443
444 #[inline]
445 fn set_visible_only(&self, visible: bool) {

Callers 2

addMethod · 0.80
addMethod · 0.80

Implementers 15

transform.rssrc/elements/transform.rs
media_query.rssrc/elements/media_query.rs
navigation_toolbar.rssrc/elements/navigation_toolbar.rs
calendar_date_picker.rssrc/elements/calendar_date_picker.rs
custom_scroll_view.rssrc/elements/custom_scroll_view.rs
preferred_size.rssrc/elements/preferred_size.rs
rust_logo.rssrc/elements/rust_logo.rs
panel.rssrc/elements/panel.rs
single_child_scroll_view.rssrc/elements/single_child_scroll_view.
choice_chip.rssrc/elements/choice_chip.rs
tab_page_selector.rssrc/elements/tab_page_selector.rs
align.rssrc/elements/align.rs

Calls 3

try_sendMethod · 0.80
as_refMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected