1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 14:38:34 +01:00

only count an element as touched if no other gestures are active

This commit is contained in:
Ellpeck 2020-06-03 16:14:45 +02:00
parent d7f43617c6
commit 08188a1a8f

View file

@ -205,7 +205,8 @@ namespace MLEM.Ui {
if (held != null && held.CanBePressed) if (held != null && held.CanBePressed)
this.System.OnElementSecondaryPressed?.Invoke(held); this.System.OnElementSecondaryPressed?.Invoke(held);
} else { } else {
var held = this.Input.TouchState.Select(l => this.GetElementUnderPos(l.Position)).FirstOrDefault(); // only count an element as being touched if no other gestures are active right now
var held = !this.Input.Gestures.Any() ? this.Input.TouchState.Select(l => this.GetElementUnderPos(l.Position)).FirstOrDefault() : null;
if (held != this.TouchedElement) { if (held != this.TouchedElement) {
if (this.TouchedElement != null) if (this.TouchedElement != null)
this.System.OnElementTouchExit?.Invoke(this.TouchedElement); this.System.OnElementTouchExit?.Invoke(this.TouchedElement);