You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix column title tooltip crash.
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user