Selecting a mod now triggers on mouseup

This commit is contained in:
Santeri Nogelainen 2018-05-02 17:11:55 +03:00
parent 420e50b6da
commit 89db7f81cb
1 changed files with 12 additions and 9 deletions

View File

@ -147,7 +147,10 @@ public Mod Mod
public virtual Mod SelectedMod => Mods.ElementAtOrDefault(selectedIndex);
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
// only trigger the event if we are inside the area of the button
if (Contains(ToScreenSpace(state.Mouse.Position - Position)))
{
switch (args.Button)
{
@ -158,7 +161,7 @@ protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
SelectNext(-1);
break;
}
}
return true;
}