diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 862403e3eae53cac77a4c493a088f450cdba7ede..33af459b0f6e239ccc0405c71eb58ffc80668c9c 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -4036,7 +4036,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } } - forwardoffset = j.offsetx + (float)Math.Round(j.sidedef.Line.Length / scalex * first.scaleX, General.Map.FormatInterface.VertexDecimals); + forwardoffset = j.offsetx + (float)Math.Round((float)Math.Round(j.sidedef.Line.Length) / scalex * first.scaleX, General.Map.FormatInterface.VertexDecimals); backwardoffset = j.offsetx; // Done this sidedef @@ -4056,7 +4056,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // Apply alignment if(alignx) { - float offset = j.offsetx - (float)Math.Round(j.sidedef.Line.Length / scalex * first.scaleX, General.Map.FormatInterface.VertexDecimals); + float offset = j.offsetx - (float)Math.Round((float)Math.Round(j.sidedef.Line.Length) / scalex * first.scaleX, General.Map.FormatInterface.VertexDecimals); offset -= j.sidedef.OffsetX; if(matchtop) @@ -4133,7 +4133,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } forwardoffset = j.offsetx; - backwardoffset = j.offsetx - (float)Math.Round(j.sidedef.Line.Length / scalex * first.scaleX, General.Map.FormatInterface.VertexDecimals); + backwardoffset = j.offsetx - (float)Math.Round((float)Math.Round(j.sidedef.Line.Length) / scalex * first.scaleX, General.Map.FormatInterface.VertexDecimals); // Done this sidedef j.sidedef.Marked = true; diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs b/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs index f21b4f684d7bcae62c7a755a2cf9d383569ab866..3178aabc83e6bbaeeab514811e20bfe614da297e 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs @@ -144,7 +144,7 @@ namespace CodeImp.DoomBuilder.BuilderModes tp.tlt.y = (float) Sidedef.Sector.CeilHeight - Sidedef.Other.Sector.FloorHeight; } } - tp.trb.x = tp.tlt.x + Sidedef.Line.Length; + tp.trb.x = tp.tlt.x + (float)Math.Round(Sidedef.Line.Length); //mxd. (G)ZDoom snaps texture coordinates to integral linedef length tp.trb.y = tp.tlt.y + (Sidedef.Other.Sector.FloorHeight - (Sidedef.Sector.FloorHeight + floorbias)); // Apply texture offset diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs index 9246b23b29506477876867bd2d89c78fb323f279..10fb532f9b183f7b9c620f76a4ea399ac4a89121 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs @@ -163,7 +163,7 @@ namespace CodeImp.DoomBuilder.BuilderModes TexturePlane tp = new TexturePlane(); float floorbias = (sourcetopheight == sourcebottomheight) ? 1.0f : 0.0f; - tp.trb.x = tp.tlt.x + Sidedef.Line.Length; + tp.trb.x = tp.tlt.x + (float)Math.Round(Sidedef.Line.Length); //mxd. (G)ZDoom snaps texture coordinates to integral linedef length tp.trb.y = tp.tlt.y + (sourcetopheight - sourcebottomheight) + floorbias; // Apply texture offset diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleBack.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleBack.cs index 4ff02cae47040d018661c0489f0be83f24dd5693..ce820ef710c94fa70f33beedf9bc7706891d89c3 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleBack.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleBack.cs @@ -1,5 +1,6 @@ #region ================== Namespaces +using System; using System.Collections.Generic; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Geometry; @@ -122,7 +123,7 @@ namespace CodeImp.DoomBuilder.BuilderModes TexturePlane tp = new TexturePlane(); float floorbias = (sourcetopheight == sourcebottomheight) ? 1.0f : 0.0f; - tp.trb.x = tp.tlt.x + Sidedef.Line.Length; + tp.trb.x = tp.tlt.x + (float)Math.Round(Sidedef.Line.Length); //mxd. (G)ZDoom snaps texture coordinates to integral linedef length tp.trb.y = tp.tlt.y + (sourcetopheight - sourcebottomheight) + floorbias; // Apply texture offset diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs index c1a2c629aa520e092c3b366be61e7abe1416a8d2..04e37acd66e26d8d0dc696a6c0de82d7c70c0333 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs @@ -148,7 +148,7 @@ namespace CodeImp.DoomBuilder.BuilderModes tp.tlt.y = tsz.y - (geotop - geobottom); if(zoffset > 0) tp.tlt.y -= zoffset; //mxd - tp.trb.x = tp.tlt.x + Sidedef.Line.Length; + tp.trb.x = tp.tlt.x + (float)Math.Round(Sidedef.Line.Length); //mxd. (G)ZDoom snaps texture coordinates to integral linedef length tp.trb.y = tp.tlt.y + (Sidedef.Sector.CeilHeight - (Sidedef.Sector.FloorHeight + floorbias)); // Apply texture offset diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs index 34d159575267faf29304550eb9f750f254fee02c..b14b168168f38e72cd4a8bbf454a051d06ffada7 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs @@ -137,7 +137,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // When lower unpegged is set, the middle texture is bound to the bottom tp.tlt.y = tsz.y - (Sidedef.Sector.CeilHeight - Sidedef.Sector.FloorHeight); } - tp.trb.x = tp.tlt.x + Sidedef.Line.Length; + tp.trb.x = tp.tlt.x + (float)Math.Round(Sidedef.Line.Length); //mxd. (G)ZDoom snaps texture coordinates to integral linedef length tp.trb.y = tp.tlt.y + (Sidedef.Sector.CeilHeight - (Sidedef.Sector.FloorHeight + floorbias)); // Apply texture offset diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs b/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs index 4fa4b514bba306c1ea41102152333903493216cf..205140fed455384ac6a0295b07774b4261cb72d0 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs @@ -139,7 +139,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // When lower unpegged is set, the lower texture is bound to the bottom tp.tlt.y = tsz.y - ((float)Sidedef.Sector.CeilHeight - Sidedef.Other.Sector.CeilHeight); } - tp.trb.x = tp.tlt.x + Sidedef.Line.Length; + tp.trb.x = tp.tlt.x + (float)Math.Round(Sidedef.Line.Length); //mxd. (G)ZDoom snaps texture coordinates to integral linedef length tp.trb.y = tp.tlt.y + (Sidedef.Sector.CeilHeight - (Sidedef.Other.Sector.CeilHeight + ceilbias)); // Apply texture offset