Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
8b79f2aa
Unverified
Commit
8b79f2aa
authored
Jun 10, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39350 from giulianob/improve-tree-redraw
Tree: Calling update in _gui_input less frequently
parents
f25f0c54
d443a132
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
tree.cpp
scene/gui/tree.cpp
+13
-8
No files found.
scene/gui/tree.cpp
View file @
8b79f2aa
...
...
@@ -2364,7 +2364,6 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
if
(
pos
.
x
<
len
)
{
cache
.
hover_type
=
Cache
::
CLICK_TITLE
;
cache
.
hover_index
=
i
;
update
();
break
;
}
}
...
...
@@ -2383,6 +2382,9 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
mpos
.
y
+=
v_scroll
->
get_value
();
}
TreeItem
*
old_it
=
cache
.
hover_item
;
int
old_col
=
cache
.
hover_cell
;
int
col
,
h
,
section
;
TreeItem
*
it
=
_find_item_at_pos
(
root
,
mpos
,
col
,
h
,
section
);
...
...
@@ -2397,18 +2399,21 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
}
}
if
(
it
!=
cache
.
hover_item
)
{
cache
.
hover_item
=
it
;
update
();
}
cache
.
hover_item
=
it
;
cache
.
hover_cell
=
col
;
if
(
it
&&
col
!=
cache
.
hover_cell
)
{
cache
.
hover_cell
=
col
;
update
();
if
(
it
!=
old_it
||
col
!=
old_col
)
{
// Only need to update if mouse enters/exits a button
bool
was_over_button
=
old_it
&&
old_it
->
cells
[
old_col
].
custom_button
;
bool
is_over_button
=
it
&&
it
->
cells
[
col
].
custom_button
;
if
(
was_over_button
||
is_over_button
)
{
update
();
}
}
}
}
// Update if mouse enters/exits columns
if
(
cache
.
hover_type
!=
old_hover
||
cache
.
hover_index
!=
old_index
)
{
update
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment