You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-26 15:46:23 +00:00
Prevent editor crash when deleting children of GraphNode
This commit is contained in:
@@ -366,6 +366,7 @@ void GraphNode::_notification(int p_what) {
|
|||||||
close_rect = Rect2();
|
close_rect = Rect2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (get_child_count() > 0) {
|
||||||
for (const KeyValue<int, Slot> &E : slot_info) {
|
for (const KeyValue<int, Slot> &E : slot_info) {
|
||||||
if (E.key < 0 || E.key >= cache_y.size()) {
|
if (E.key < 0 || E.key >= cache_y.size()) {
|
||||||
continue;
|
continue;
|
||||||
@@ -394,12 +395,19 @@ void GraphNode::_notification(int p_what) {
|
|||||||
// Draw slot stylebox.
|
// Draw slot stylebox.
|
||||||
if (s.draw_stylebox) {
|
if (s.draw_stylebox) {
|
||||||
Control *c = Object::cast_to<Control>(get_child(E.key));
|
Control *c = Object::cast_to<Control>(get_child(E.key));
|
||||||
|
if (!c || !c->is_visible_in_tree()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (c->is_set_as_top_level()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Rect2 c_rect = c->get_rect();
|
Rect2 c_rect = c->get_rect();
|
||||||
c_rect.position.x = sb->get_margin(SIDE_LEFT);
|
c_rect.position.x = sb->get_margin(SIDE_LEFT);
|
||||||
c_rect.size.width = w;
|
c_rect.size.width = w;
|
||||||
draw_style_box(sb_slot, c_rect);
|
draw_style_box(sb_slot, c_rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (resizable) {
|
if (resizable) {
|
||||||
draw_texture(resizer, get_size() - resizer->get_size(), resizer_color);
|
draw_texture(resizer, get_size() - resizer->get_size(), resizer_color);
|
||||||
|
|||||||
Reference in New Issue
Block a user