mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
FixFormat
This commit is contained in:
parent
446611531b
commit
a35cd68dd7
@ -142,8 +142,7 @@ namespace XNodeEditor {
|
||||
|
||||
p = new Vector2(-p.y, p.x) * Mathf.Sign(side) * tangentLength;
|
||||
inputTangent = p;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
inputTangent = Vector2.left * dist_ab * 0.01f * zoom;
|
||||
}
|
||||
|
||||
@ -155,7 +154,7 @@ namespace XNodeEditor {
|
||||
int division = Mathf.RoundToInt(.1f * dist_ab) + 3;
|
||||
Vector3[] points = Handles.MakeBezierPoints(point_a, point_b, tangent_a, tangent_b, division);
|
||||
// Coloring and bezier drawing.
|
||||
for (int j = 0; j < points.Length - 1; j++) {
|
||||
for (int j = 0; j < points.Length - 1; j++) {
|
||||
Handles.color = gradient.Evaluate((j + 1f) / (points.Length));
|
||||
Handles.DrawAAPolyLine(bezier_width, points[j], points[j + 1]);
|
||||
}
|
||||
@ -170,7 +169,7 @@ namespace XNodeEditor {
|
||||
int line_width = 5;
|
||||
// Draws the line with the coloring.
|
||||
Vector2 prev_point = point_a;
|
||||
for (float j = 0; j < 1; j += 10f / Vector2.Distance(point_a, point_b)) {
|
||||
for (float j = 0; j < 1; j += 10f / Vector2.Distance(point_a, point_b)) {
|
||||
Vector2 lerp = Vector2.Lerp(point_a, point_b, j);
|
||||
Handles.color = gradient.Evaluate(j);
|
||||
Handles.DrawAAPolyLine(line_width, prev_point, lerp);
|
||||
|
||||
@ -73,8 +73,8 @@ namespace XNodeEditor {
|
||||
}
|
||||
Gradient grad = new Gradient();
|
||||
grad.SetKeys(
|
||||
new GradientColorKey[] { new GradientColorKey(a, 0f), new GradientColorKey(b, 1f) },
|
||||
new GradientAlphaKey[] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) }
|
||||
new GradientColorKey[] { new GradientColorKey(a, 0f), new GradientColorKey(b, 1f) },
|
||||
new GradientAlphaKey[] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) }
|
||||
);
|
||||
return grad;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user