mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 14:31:50 +00:00
Fixed, Classic modes: fixed excessive redraws and text label / sector highlight flickering when using rectangular selection with modifier keys.
This commit is contained in:
parent
411368307f
commit
70586e3538
2 changed files with 26 additions and 18 deletions
|
@ -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!
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue