The control this one is clipped by
(&self, other: Option<Id>)
| 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) { |
no test coverage detected