fixed potential panic when trying to bring deleted node into view
@@ -113,7 +113,8 @@ impl Control for ScrollPanel {
self.invalidate_arrange();
}
ScrollPanelMessage::BringIntoView(handle) => {
- let size = ui.node(handle).actual_size();
+ if let Some(node_to_focus_ref) = ui.try_get_node(handle) {
+ let size = node_to_focus_ref.actual_size();
let mut parent = handle;
let mut relative_position = Vector2::default();
while parent.is_some() && parent != self.handle {
@@ -156,6 +157,7 @@ impl Control for ScrollPanel {
}
}
}
+}
impl ScrollPanel {
pub fn new(widget: Widget) -> Self {
