mirror of
https://github.com/godotengine/godot.git
synced 2024-11-29 23:53:08 +00:00
Check for null pointer in get_column_width(0)
(cherry picked from commit fa6fd3a2d0
)
This commit is contained in:
parent
a5bcacb115
commit
672fdb7af2
@ -3370,9 +3370,13 @@ int Tree::get_column_width(int p_column) const {
|
||||
if (!columns[p_column].expand)
|
||||
return columns[p_column].min_width;
|
||||
|
||||
int expand_area = get_size().width;
|
||||
|
||||
Ref<StyleBox> bg = cache.bg;
|
||||
|
||||
int expand_area = get_size().width - (bg->get_margin(MARGIN_LEFT) + bg->get_margin(MARGIN_RIGHT));
|
||||
if (bg.is_valid()) {
|
||||
expand_area -= bg->get_margin(MARGIN_LEFT) + bg->get_margin(MARGIN_RIGHT);
|
||||
}
|
||||
|
||||
if (v_scroll->is_visible_in_tree())
|
||||
expand_area -= v_scroll->get_combined_minimum_size().width;
|
||||
|
Loading…
Reference in New Issue
Block a user