MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_minimum_size

Method get_minimum_size

scene/gui/graph_node.cpp:959–990  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957}
958
959Size2 GraphNode::get_minimum_size() const {
960 Ref<StyleBox> sb_panel = theme_cache.panel;
961 Ref<StyleBox> sb_titlebar = theme_cache.titlebar;
962 Ref<StyleBox> sb_slot = theme_cache.slot;
963
964 int separation = theme_cache.separation;
965 Size2 minsize = titlebar_hbox->get_minimum_size() + sb_titlebar->get_minimum_size();
966
967 for (int i = 0; i < get_child_count(false); i++) {
968 Control *child = as_sortable_control(get_child(i, false));
969 if (!child) {
970 continue;
971 }
972
973 Size2i size = child->get_combined_minimum_size();
974 size.width += sb_panel->get_minimum_size().width;
975 if (slot_table.has(i)) {
976 size += slot_table[i].draw_stylebox ? sb_slot->get_minimum_size() : Size2();
977 }
978
979 minsize.height += size.height;
980 minsize.width = MAX(minsize.width, size.width);
981
982 if (i > 0) {
983 minsize.height += separation;
984 }
985 }
986
987 minsize.height += sb_panel->get_minimum_size().height;
988
989 return minsize;
990}
991
992void GraphNode::_port_pos_update() {
993 int edgeofs = theme_cache.port_h_offset;

Callers 3

_resortMethod · 0.45
_notificationMethod · 0.45
_port_pos_updateMethod · 0.45

Calls 3

MAXFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected