mirror of
https://github.com/godotengine/godot.git
synced 2026-02-07 11:21:49 +00:00
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:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user