From 672e5ba6f663028b27366bca9433d6f543403c44 Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Sun, 30 May 2021 18:27:56 +0200 Subject: [PATCH] Linedefs Mode: fixed a problem where flipping a highlighted linedef would also select the linedef. Fixes #571 --- .../BuilderModes/ClassicModes/LinedefsMode.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs index d025996..dbb9b1b 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs @@ -1933,6 +1933,8 @@ namespace CodeImp.DoomBuilder.BuilderModes [BeginAction("fliplinedefs")] public void FlipLinedefs() { + bool deselect = false; + // No selected lines? ICollection selected = General.Map.Map.GetSelectedLinedefs(true); if(selected.Count == 0) @@ -1943,6 +1945,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // Select the highlighted item highlighted.Selected = true; selected.Add(highlighted); + + // If nothing was selected we want to deselect the highlighted line when we're done + deselect = true; } } @@ -1967,6 +1972,11 @@ namespace CodeImp.DoomBuilder.BuilderModes { General.Interface.DisplayStatus(StatusType.Warning, (selectedcount > 1 ? "Selected linedefs already point in the right direction!" : "Selected linedef already points in the right direction!")); + + // There might be linedefs that were filtered out, so deselect all linedefs (if necessary) anyway + if (deselect) + General.Map.Map.ClearSelectedLinedefs(); + return; } @@ -1989,6 +1999,9 @@ namespace CodeImp.DoomBuilder.BuilderModes l.FlipSidedefs(); } + if(deselect) + General.Map.Map.ClearSelectedLinedefs(); + // Redraw General.Map.Map.Update(); General.Map.IsChanged = true;