diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index ac1dea5e94b..cdb73e36987 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 points = get_connection_line(p_from / p_zoom, p_to / p_zoom); Vector scaled_points; Vector 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); }