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
ac58372d
Unverified
Commit
ac58372d
authored
May 16, 2020
by
Rémi Verschelde
Committed by
GitHub
May 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38463 from smartin015/3.2-fixgedit
Remove get_local_mouse_position() hack in GraphEdit
parents
cd168363
00457c68
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
graph_edit.cpp
scene/gui/graph_edit.cpp
+5
-8
graph_edit.h
scene/gui/graph_edit.h
+0
-1
No files found.
scene/gui/graph_edit.cpp
View file @
ac58372d
...
@@ -768,9 +768,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
...
@@ -768,9 +768,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
if
(
mm
.
is_valid
()
&&
dragging
)
{
if
(
mm
.
is_valid
()
&&
dragging
)
{
just_selected
=
true
;
just_selected
=
true
;
// TODO: Remove local mouse pos hack if/when InputEventMouseMotion is fixed to support floats
drag_accum
+=
mm
->
get_relative
();
//drag_accum+=Vector2(mm->get_relative().x,mm->get_relative().y);
drag_accum
=
get_local_mouse_position
()
-
drag_origin
;
for
(
int
i
=
get_child_count
()
-
1
;
i
>=
0
;
i
--
)
{
for
(
int
i
=
get_child_count
()
-
1
;
i
>=
0
;
i
--
)
{
GraphNode
*
gn
=
Object
::
cast_to
<
GraphNode
>
(
get_child
(
i
));
GraphNode
*
gn
=
Object
::
cast_to
<
GraphNode
>
(
get_child
(
i
));
if
(
gn
&&
gn
->
is_selected
())
{
if
(
gn
&&
gn
->
is_selected
())
{
...
@@ -789,7 +787,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
...
@@ -789,7 +787,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
}
}
if
(
mm
.
is_valid
()
&&
box_selecting
)
{
if
(
mm
.
is_valid
()
&&
box_selecting
)
{
box_selecting_to
=
get_local_mouse
_position
();
box_selecting_to
=
mm
->
get
_position
();
box_selecting_rect
=
Rect2
(
MIN
(
box_selecting_from
.
x
,
box_selecting_to
.
x
),
box_selecting_rect
=
Rect2
(
MIN
(
box_selecting_from
.
x
,
box_selecting_to
.
x
),
MIN
(
box_selecting_from
.
y
,
box_selecting_to
.
y
),
MIN
(
box_selecting_from
.
y
,
box_selecting_to
.
y
),
...
@@ -849,7 +847,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
...
@@ -849,7 +847,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
if
(
gn
)
{
if
(
gn
)
{
Rect2
r
=
gn
->
get_rect
();
Rect2
r
=
gn
->
get_rect
();
r
.
size
*=
zoom
;
r
.
size
*=
zoom
;
if
(
r
.
has_point
(
get_local_mouse
_position
()))
{
if
(
r
.
has_point
(
b
->
get
_position
()))
{
gn
->
set_selected
(
false
);
gn
->
set_selected
(
false
);
}
}
}
}
...
@@ -887,7 +885,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
...
@@ -887,7 +885,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
continue
;
continue
;
}
}
if
(
gn_selected
->
has_point
(
gn_selected
->
get_local_mouse
_position
()))
{
if
(
gn_selected
->
has_point
(
b
->
get_position
()
-
gn_selected
->
get
_position
()))
{
gn
=
gn_selected
;
gn
=
gn_selected
;
break
;
break
;
}
}
...
@@ -901,7 +899,6 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
...
@@ -901,7 +899,6 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
dragging
=
true
;
dragging
=
true
;
drag_accum
=
Vector2
();
drag_accum
=
Vector2
();
drag_origin
=
get_local_mouse_position
();
just_selected
=
!
gn
->
is_selected
();
just_selected
=
!
gn
->
is_selected
();
if
(
!
gn
->
is_selected
()
&&
!
Input
::
get_singleton
()
->
is_key_pressed
(
KEY_CONTROL
))
{
if
(
!
gn
->
is_selected
()
&&
!
Input
::
get_singleton
()
->
is_key_pressed
(
KEY_CONTROL
))
{
for
(
int
i
=
0
;
i
<
get_child_count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
get_child_count
();
i
++
)
{
...
@@ -939,7 +936,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
...
@@ -939,7 +936,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
}
}
box_selecting
=
true
;
box_selecting
=
true
;
box_selecting_from
=
get_local_mouse
_position
();
box_selecting_from
=
b
->
get
_position
();
if
(
b
->
get_control
())
{
if
(
b
->
get_control
())
{
box_selection_mode_additive
=
true
;
box_selection_mode_additive
=
true
;
previus_selected
.
clear
();
previus_selected
.
clear
();
...
...
scene/gui/graph_edit.h
View file @
ac58372d
...
@@ -97,7 +97,6 @@ private:
...
@@ -97,7 +97,6 @@ private:
bool
dragging
;
bool
dragging
;
bool
just_selected
;
bool
just_selected
;
Vector2
drag_accum
;
Vector2
drag_accum
;
Point2
drag_origin
;
// Workaround for GH-5907
float
zoom
;
float
zoom
;
...
...
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