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
parent 4f9111d075
commit d65fb7bbab
3 changed files with 36 additions and 19 deletions

View file

@ -1001,23 +1001,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

@ -1716,22 +1716,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

@ -908,22 +908,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;
}
}