Skip to content

Commit 5b596a5

Browse files
committed
drawdraging issue fixed
1 parent 786ff95 commit 5b596a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Assets/RuntimeNodeEditor/Scripts/Graph/BezierCurveDrawer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,15 @@ private void DrawDragging(SocketHandle port)
111111
_pointerLocator.localPosition = localPointerPos;
112112

113113
var pointList = new List<Vector2>();
114-
114+
var step = 1f / (vertexCount - 1);
115+
var t = 0f;
115116
for (float i = 0; i < vertexCount; i++)
116117
{
117-
var t = i / vertexCount;
118118
pointList.Add(Utility.QuadraticCurve(GetLocalPoint(port.handle1.position),
119119
GetLocalPoint(port.handle2.position),
120120
GetLocalPoint(_pointerLocator.position),
121121
t));
122+
t += step;
122123
}
123124

124125
_lineRenderer.m_points = pointList.ToArray();

0 commit comments

Comments
 (0)