Skip to content
Snippets Groups Projects
Commit 7874b276 authored by codeimp's avatar codeimp
Browse files

Fixed bug which sometimes causes the drawing vertex to jump to (0, 0) while drawing geometry.

parent 1a1c4e73
No related branches found
No related tags found
No related merge requests found
......@@ -247,6 +247,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
List<Vector2D> coords = nl.GetGridIntersections();
// Find nearest grid intersection
bool found = false;
float found_distance = float.MaxValue;
Vector2D found_coord = new Vector2D();
foreach(Vector2D v in coords)
......@@ -256,14 +257,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
found_distance = delta.GetLengthSq();
found_coord = v;
found = true;
}
}
// Align to the closest grid intersection
p.pos = found_coord;
p.stitch = true;
p.stitchline = true;
return p;
if(found)
{
// Align to the closest grid intersection
p.pos = found_coord;
p.stitch = true;
p.stitchline = true;
return p;
}
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment