From 1d65205a6b166fd2b7093e6ee111e6c759791015 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 29 May 2024 13:18:43 +0200 Subject: [PATCH] Filter non-marked linedefs by edited area when accepting Edit Selection mode --- .../ClassicModes/EditSelectionMode.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs index 62884a2a..32defe7f 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs @@ -1806,13 +1806,18 @@ namespace CodeImp.DoomBuilder.BuilderModes Sector vsector = null; General.Settings.FindDefaultDrawSettings(); - // Go for all sidedes in the new geometry - List newsides = General.Map.Map.GetMarkedSidedefs(true); - List oldlines = General.Map.Map.GetMarkedLinedefs(false); //mxd + // Go for all sidedefs in the new geometry + HashSet newsides = new HashSet(General.Map.Map.GetMarkedSidedefs(true)); + HashSet oldlines = new HashSet(General.Map.Map.GetMarkedLinedefs(false)); + + // Determine area in which we are editing + RectangleF editarea = MapSet.CreateArea(General.Map.Map.GetMarkedLinedefs(true)); + editarea = MapSet.IncreaseArea(editarea, General.Map.Map.GetMarkedVertices(true)); + editarea.Inflate(1.0f, 1.0f); + oldlines = MapSet.FilterByArea(oldlines, ref editarea); //mxd. Let's use a blockmap... - RectangleF area = MapSet.CreateArea(oldlines); - BlockMap blockmap = new BlockMap(area); + BlockMap blockmap = new BlockMap(editarea); blockmap.AddLinedefsSet(oldlines); foreach(Sidedef s in newsides)