Skip to content

Commit 5a8c3bb

Browse files
committed
Fix column title tooltip crash.
1 parent 06827c9 commit 5a8c3bb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scene/gui/tree.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6403,14 +6403,15 @@ String Tree::get_tooltip(const Point2 &p_pos) const {
64036403
// Walk forwards until we know which column we're in.
64046404
int next_edge = 0;
64056405
int i = 0;
6406-
for (; i < columns.size(); i++) {
6406+
for (const ColumnInfo &column : columns) {
6407+
next_edge += get_column_width(i++);
6408+
64076409
if (pos_x < next_edge) {
6410+
if (!column.title_tooltip.is_empty()) {
6411+
return column.title_tooltip;
6412+
}
64086413
break;
64096414
}
6410-
next_edge += get_column_width(i);
6411-
}
6412-
if (!columns[i - 1].title_tooltip.is_empty()) {
6413-
return columns[i - 1].title_tooltip;
64146415
}
64156416

64166417
// If the column has no tooltip, use the default.

0 commit comments

Comments
 (0)