mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
made the new changes work correctly with touch input
This commit is contained in:
parent
48b96a10a4
commit
0918e1700b
1 changed files with 6 additions and 5 deletions
|
@ -288,13 +288,14 @@ namespace MLEM.Input {
|
||||||
this.LastViewportTouchState = this.ViewportTouchState;
|
this.LastViewportTouchState = this.ViewportTouchState;
|
||||||
|
|
||||||
this.TouchState = active ? TouchPanel.GetState() : default;
|
this.TouchState = active ? TouchPanel.GetState() : default;
|
||||||
this.ViewportTouchState = this.TouchState;
|
if (this.TouchState.Count > 0 && this.ViewportOffset != Point.Zero) {
|
||||||
if (this.ViewportTouchState.Count > 0 && this.ViewportOffset != Point.Zero) {
|
this.ViewportTouchState = new List<TouchLocation>();
|
||||||
for (var i = 0; i < this.ViewportTouchState.Count; i++) {
|
foreach (var touch in this.TouchState) {
|
||||||
var touch = this.ViewportTouchState[i];
|
|
||||||
touch.TryGetPreviousLocation(out var previous);
|
touch.TryGetPreviousLocation(out var previous);
|
||||||
this.ViewportTouchState[i] = new TouchLocation(touch.Id, touch.State, touch.Position + this.ViewportOffset.ToVector2(), previous.State, previous.Position + this.ViewportOffset.ToVector2());
|
this.ViewportTouchState.Add(new TouchLocation(touch.Id, touch.State, touch.Position + this.ViewportOffset.ToVector2(), previous.State, previous.Position + this.ViewportOffset.ToVector2()));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.ViewportTouchState = this.TouchState;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gestures.Clear();
|
this.gestures.Clear();
|
||||||
|
|
Loading…
Reference in a new issue