Skip to content

Commit 9470833

Browse files
committed
fix bugs
1 parent e341611 commit 9470833

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

OngekiFumenEditor/Modules/FumenVisualEditor/Graphics/Drawing/TargetImpl/VisibleLineVerticesQuery.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,29 +129,30 @@ void CheckIfSoflanChanged2(double totalTGrid, bool isVailed)
129129
}
130130

131131
//optimze vertices
132-
for (var i = 0; i < tempVertices.Count - 3; i++)
132+
var idx = 0;
133+
for (; idx < tempVertices.Count - 3; idx++)
133134
{
134-
var a1 = tempVertices[i];
135-
var a2 = tempVertices[i + 1];
136-
var b1 = tempVertices[i + 2];
137-
var b2 = tempVertices[i + 3];
135+
var a1 = tempVertices[idx];
136+
var a2 = tempVertices[idx + 1];
137+
var b1 = tempVertices[idx + 2];
138+
var b2 = tempVertices[idx + 3];
138139

139140
if (!(a1 == b1 && a2 == b2))
140141
outVertices.Add(a1);
141142

142143
if ((a1.Point.X == a2.Point.X && a2.Point.X == b1.Point.X) || (a1.Point.Y == a2.Point.Y && a2.Point.Y == b1.Point.Y))
143144
{
144145
outVertices.Add(b1);
145-
i += 2;
146+
idx += 2;
146147
}
147148
else if (a1.Point == a2.Point)
148149
{
149-
i += 1;
150+
idx += 1;
150151
}
151152
}
152153

153154
//add remain vertices
154-
outVertices.AddRange(tempVertices.Skip(tempVertices.Count - 3));
155+
outVertices.AddRange(tempVertices.Skip(idx));
155156

156157
ObjectPool<List<SoflanPoint>>.Return(affectedSoflanPoints);
157158
ObjectPool<List<LineVertex>>.Return(tempVertices);

0 commit comments

Comments
 (0)