Stair Sector Builder: properly snap new vertices to integer positions, if required

This commit is contained in:
spherallic 2024-06-18 13:54:54 +02:00
parent 0a41dfd637
commit a832e73a4a

View file

@ -1067,10 +1067,11 @@ namespace CodeImp.DoomBuilder.StairSectorBuilderMode
private DrawnVertex SectorVertex(double x, double y)
{
DrawnVertex v = new DrawnVertex();
int precision = General.Settings.SnapToInteger ? 0 : General.Map.FormatInterface.VertexDecimals;
v.stitch = true;
v.stitchline = true;
v.pos = new Vector2D(Math.Round(x, General.Map.FormatInterface.VertexDecimals), Math.Round(y, General.Map.FormatInterface.VertexDecimals));
v.pos = new Vector2D(Math.Round(x, precision), Math.Round(y, precision));
return v;
}