Fixed, Classic modes: fixed excessive redraws and text label / sector highlight flickering when using rectangular selection with modifier keys.

This commit is contained in:
MaxED 2016-04-28 20:41:10 +00:00
parent 411368307f
commit 70586e3538
2 changed files with 26 additions and 18 deletions

View file

@ -592,11 +592,8 @@ namespace CodeImp.DoomBuilder.Editing
public override void OnKeyDown(KeyEventArgs e)
{
// Update marque color when modifier keys are pressed
if(selecting && (e.Control || e.Shift))
{
if(selecting && (e.Control || e.Shift) && marqueSelectionMode != GetMultiSelectionMode())
OnUpdateMultiSelection();
General.Interface.RedrawDisplay();
}
base.OnKeyDown(e);
}
@ -605,11 +602,9 @@ namespace CodeImp.DoomBuilder.Editing
public override void OnKeyUp(KeyEventArgs e)
{
// Update marque color when modifier keys are released
if(selecting && (!e.Control || !e.Shift))
{
if(selecting && (!e.Control || !e.Shift) && marqueSelectionMode != GetMultiSelectionMode())
OnUpdateMultiSelection();
General.Interface.RedrawDisplay();
}
base.OnKeyUp(e);
}
@ -819,6 +814,8 @@ namespace CodeImp.DoomBuilder.Editing
/// </summary>
protected virtual void OnUpdateMultiSelection()
{
marqueSelectionMode = GetMultiSelectionMode(); //mxd
selectionrect.X = selectstart.x;
selectionrect.Y = selectstart.y;
selectionrect.Width = mousemappos.x - selectstart.x;
@ -837,6 +834,12 @@ namespace CodeImp.DoomBuilder.Editing
}
}
//mxd
protected virtual MarqueSelectionMode GetMultiSelectionMode()
{
return MarqueSelectionMode.SELECT;
}
/// <summary>
/// Call this to draw the selection on the overlay layer.
/// Must call renderer.StartOverlay first!

View file

@ -134,19 +134,24 @@ namespace CodeImp.DoomBuilder.BuilderModes
protected override void OnUpdateMultiSelection()
{
base.OnUpdateMultiSelection();
if(General.Interface.CtrlState && General.Interface.ShiftState)
marqueSelectionMode = MarqueSelectionMode.INTERSECT;
else if(General.Interface.CtrlState)
marqueSelectionMode = MarqueSelectionMode.SUBTRACT;
else if(General.Interface.ShiftState ^ BuilderPlug.Me.AdditiveSelect)
marqueSelectionMode = MarqueSelectionMode.ADD;
else
marqueSelectionMode = MarqueSelectionMode.SELECT;
marqueSelectionIncludesThings = General.Interface.AltState;
}
//mxd
protected override MarqueSelectionMode GetMultiSelectionMode()
{
if(General.Interface.CtrlState && General.Interface.ShiftState)
return MarqueSelectionMode.INTERSECT;
if(General.Interface.CtrlState)
return MarqueSelectionMode.SUBTRACT;
if(General.Interface.ShiftState ^ BuilderPlug.Me.AdditiveSelect)
return MarqueSelectionMode.ADD;
return MarqueSelectionMode.SELECT;
}
//mxd
public override void OnMapTestEnd(bool testFromCurrentPosition)
{