Fixed an issue where selected objects were unnecessarily cleared in visual mode, resulting in slowdowns. Partly addresses #337.

This commit is contained in:
biwa 2019-12-27 17:00:13 +01:00 committed by spherallic
parent 330ab8d367
commit 35da8fee2c
1 changed files with 12 additions and 7 deletions

View File

@ -252,16 +252,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
public void PreAction(int multiselectionundogroup)
{
actionresult = new VisualActionResult();
PickTargetUnlocked();
// If the action is not performed on a selected object, clear the
// current selection and make a temporary selection for the target.
if((target.picked != null) && !target.picked.Selected && (BuilderPlug.Me.VisualModeClearSelection || (selectedobjects.Count == 0)))
if ((target.picked != null) && !target.picked.Selected && (BuilderPlug.Me.VisualModeClearSelection || (selectedobjects.Count == 0)))
{
// Single object, no selection
singleselection = true;
ClearSelection();
// Only clear the selection if anything is selected, since it can be very time consuming on huge maps
if(BuilderPlug.Me.VisualModeClearSelection && selectedobjects.Count > 0)
ClearSelection();
undocreated = false;
}
else
@ -313,8 +317,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
selectionchanged = false;
if(singleselection) ClearSelection();
// Only clear the selection if anything is selected, since it can be very time consuming on huge maps
if (singleselection && selectedobjects.Count > 0) ClearSelection();
UpdateChangedObjects();
ShowTargetInfo();
@ -2233,7 +2238,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd
if (displaystatus)
{
General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
General.Interface.DisplayStatus(StatusType.Selection, string.Empty);
}
}