Fixed a bug where map elements could be selected multiple times when paint selecting in visual mode. Fixes #519. Fixes #520

This commit is contained in:
biwa 2021-01-31 00:12:07 +01:00 committed by sphere
parent f8fbcbcd1f
commit 914fb7ea34
3 changed files with 36 additions and 19 deletions

View file

@ -1009,23 +1009,28 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toggle selected state
if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditivePaintSelect)
{
this.selected = true;
mode.AddSelectedObject(this);
if (!selected)
{
selected = true;
mode.AddSelectedObject(this);
}
}
else if (General.Interface.CtrlState)
{
this.selected = false;
mode.RemoveSelectedObject(this);
if (selected)
{
selected = false;
mode.RemoveSelectedObject(this);
}
}
else
{
if (this.selected)
if (selected)
mode.RemoveSelectedObject(this);
else
mode.AddSelectedObject(this);
this.selected = !this.selected;
selected = !selected;
}
}

View file

@ -1580,22 +1580,28 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toggle selected state
if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditivePaintSelect)
{
this.selected = true;
mode.AddSelectedObject(this);
if (!selected)
{
selected = true;
mode.AddSelectedObject(this);
}
}
else if (General.Interface.CtrlState)
{
this.selected = false;
mode.RemoveSelectedObject(this);
if (selected)
{
selected = false;
mode.RemoveSelectedObject(this);
}
}
else
{
if (this.selected)
if (selected)
mode.RemoveSelectedObject(this);
else
mode.AddSelectedObject(this);
this.selected = !this.selected;
selected = !selected;
}
}

View file

@ -931,22 +931,28 @@ namespace CodeImp.DoomBuilder.BuilderModes
// toggle selected state
if (General.Interface.ShiftState ^ BuilderPlug.Me.AdditivePaintSelect)
{
this.selected = true;
mode.AddSelectedObject(this);
if (!selected)
{
selected = true;
mode.AddSelectedObject(this);
}
}
else if (General.Interface.CtrlState)
{
this.selected = false;
mode.RemoveSelectedObject(this);
if (selected)
{
selected = false;
mode.RemoveSelectedObject(this);
}
}
else
{
if (this.selected)
if (selected)
mode.RemoveSelectedObject(this);
else
mode.AddSelectedObject(this);
this.selected = !this.selected;
selected = !selected;
}
}