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
98ad32c1
Commit
98ad32c1
authored
Oct 13, 2016
by
George Marques
Committed by
GitHub
Oct 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6809 from volzhs/graphedit-zoom
Fix GraphEdit connection wire when zoom in/out
parents
682c20be
6227e38e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
graph_edit.cpp
scene/gui/graph_edit.cpp
+6
-5
No files found.
scene/gui/graph_edit.cpp
View file @
98ad32c1
...
...
@@ -151,7 +151,7 @@ void GraphEdit::_update_scroll_offset() {
}
}
connections_layer
->
set_pos
(
-
Point2
(
h_scroll
->
get_val
(),
v_scroll
->
get_val
())
*
zoom
);
connections_layer
->
set_pos
(
-
Point2
(
h_scroll
->
get_val
(),
v_scroll
->
get_val
()));
set_block_minimum_size_adjust
(
false
);
awaiting_scroll_offset_update
=
false
;
...
...
@@ -650,8 +650,8 @@ void GraphEdit::_draw_cos_line(CanvasItem* p_where,const Vector2& p_from, const
cp_offset
=
MAX
(
MIN
(
cp_len
-
diff
,
cp_neg_len
),
-
diff
*
0.5
);
}
Vector2
c1
=
Vector2
(
cp_offset
,
0
);
Vector2
c2
=
Vector2
(
-
cp_offset
,
0
);
Vector2
c1
=
Vector2
(
cp_offset
*
zoom
,
0
);
Vector2
c2
=
Vector2
(
-
cp_offset
*
zoom
,
0
);
int
lines
=
0
;
_bake_segment2d
(
p_where
,
0
,
1
,
p_from
,
c1
,
p_to
,
c2
,
0
,
3
,
9
,
8
,
p_color
,
p_to_color
,
lines
);
...
...
@@ -726,9 +726,9 @@ void GraphEdit::_connections_layer_draw() {
continue
;
}
Vector2
frompos
=
gfrom
->
get_connection_output_pos
(
E
->
get
().
from_port
)
+
gfrom
->
get_offset
();
Vector2
frompos
=
gfrom
->
get_connection_output_pos
(
E
->
get
().
from_port
)
+
gfrom
->
get_offset
()
*
zoom
;
Color
color
=
gfrom
->
get_connection_output_color
(
E
->
get
().
from_port
);
Vector2
topos
=
gto
->
get_connection_input_pos
(
E
->
get
().
to_port
)
+
gto
->
get_offset
();
Vector2
topos
=
gto
->
get_connection_input_pos
(
E
->
get
().
to_port
)
+
gto
->
get_offset
()
*
zoom
;
Color
tocolor
=
gto
->
get_connection_input_color
(
E
->
get
().
to_port
);
_draw_cos_line
(
connections_layer
,
frompos
,
topos
,
color
,
tocolor
);
...
...
@@ -1052,6 +1052,7 @@ void GraphEdit::set_zoom(float p_zoom) {
top_layer
->
update
();
_update_scroll
();
connections_layer
->
update
();
if
(
is_visible
())
{
...
...
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