diff options
author | K. S. Ernest (iFire) Lee <fire@users.noreply.github.com> | 2021-08-22 14:25:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 14:25:56 -0700 |
commit | e63f7dcf03bc451876ef756ff6c67ebc107110b8 (patch) | |
tree | 320112b7242c6d2e42f264bc19a541fb16ace2e6 | |
parent | fb176d5f6e6dc2b43c630a041a8ab7d737173ec4 (diff) | |
parent | 856d0b52e53593e8706b295c38fffb5d7239e551 (diff) |
Merge pull request #51992 from Jummit/fix-connections-colors
Fix GraphEdit connection colors
-rw-r--r-- | scene/gui/graph_edit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index ac1dea5e94..cdb73e3698 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -823,9 +823,9 @@ void GraphEdit::_draw_connection_line(CanvasItem *p_where, const Vector2 &p_from Vector<Vector2> points = get_connection_line(p_from / p_zoom, p_to / p_zoom); Vector<Vector2> scaled_points; Vector<Color> colors; - float length = p_from.distance_to(p_to); + float length = (p_from / p_zoom).distance_to(p_to / p_zoom); for (int i = 0; i < points.size(); i++) { - float d = p_from.distance_to(points[i]) / length; + float d = (p_from / p_zoom).distance_to(points[i]) / length; colors.push_back(p_color.lerp(p_to_color, d)); scaled_points.push_back(points[i] * p_zoom); } |