Merge pull request #115802 from BrotherShort/give_hovered_pos_a_default_value

Give tree's `hovered_pos` a negative default value.
This commit is contained in:
Thaddeus Crews
2026-02-05 09:32:30 -06:00
2 changed files with 5 additions and 3 deletions

View File

@@ -4327,8 +4327,9 @@ void Tree::_determine_hovered_item() {
cache.hover_header_row = false;
cache.hover_header_column = 0;
if (show_column_titles && is_mouse_hovering) {
pos.y -= _get_title_button_height();
if (pos.y < 0) {
int tbh = _get_title_button_height();
pos.y -= tbh;
if (pos.y < 0 && pos.y >= -tbh) {
pos.x += theme_cache.offset.x;
int len = 0;
for (int i = 0; i < columns.size(); i++) {
@@ -5024,6 +5025,7 @@ void Tree::_notification(int p_what) {
} break;
case NOTIFICATION_MOUSE_EXIT: {
hovered_pos = Vector2(-1.0, -1.0);
is_mouse_hovering = false;
if (enable_drag_unfolding && drop_mode_over) {
_reset_drop_mode_over();

View File

@@ -499,7 +499,7 @@ private:
bool pressing_for_editor = false;
Vector2 pressing_pos;
Vector2 hovered_pos;
Vector2 hovered_pos = Vector2(-1.0, -1.0);
bool is_mouse_hovering = false;
float range_drag_base = 0.0;