From 5a8c3bb0de429976b87a787f64a2be9bce07ed87 Mon Sep 17 00:00:00 2001 From: Mounir Tohami <53877170+WhalesState@users.noreply.github.com> Date: Sun, 5 Oct 2025 17:48:21 +0300 Subject: [PATCH] Fix column title tooltip crash. --- scene/gui/tree.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 6bfc08257aa..c5d01a0e1ed 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -6403,14 +6403,15 @@ String Tree::get_tooltip(const Point2 &p_pos) const { // Walk forwards until we know which column we're in. int next_edge = 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 (!column.title_tooltip.is_empty()) { + return column.title_tooltip; + } 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.