mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix column title tooltip crash.
This commit is contained in:
parent
06827c91c6
commit
5a8c3bb0de
1 changed files with 6 additions and 5 deletions
|
@ -6403,14 +6403,15 @@ String Tree::get_tooltip(const Point2 &p_pos) const {
|
||||||
// Walk forwards until we know which column we're in.
|
// Walk forwards until we know which column we're in.
|
||||||
int next_edge = 0;
|
int next_edge = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < columns.size(); i++) {
|
for (const ColumnInfo &column : columns) {
|
||||||
|
next_edge += get_column_width(i++);
|
||||||
|
|
||||||
if (pos_x < next_edge) {
|
if (pos_x < next_edge) {
|
||||||
|
if (!column.title_tooltip.is_empty()) {
|
||||||
|
return column.title_tooltip;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
next_edge += get_column_width(i);
|
|
||||||
}
|
|
||||||
if (!columns[i - 1].title_tooltip.is_empty()) {
|
|
||||||
return columns[i - 1].title_tooltip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the column has no tooltip, use the default.
|
// If the column has no tooltip, use the default.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue