Skip to content

Commit

Permalink
Fix: Clear mouse delta every frame
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Jan 4, 2025
1 parent b1a2a3d commit c030cbf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ public void reset() {
justPressedKeys[i] = false;
}
}
for(int i = 0; i < touchX.length; i++) {
deltaX[i] = 0;
deltaY[i] = 0;
}
}

public void setDelta(int touchId, int x, int y) {
Expand Down Expand Up @@ -464,7 +468,7 @@ protected int getRelativeY(TouchWrapper touch, HTMLCanvasElementWrapper target)
return Math.round(yScaleRatio * getRelativeY(target, touch));
}

private int getClientWidth(HTMLCanvasElementWrapper target) {
private int getClientWidth(HTMLCanvasElementWrapper target) {
return target.getClientWidth();
}

Expand Down

0 comments on commit c030cbf

Please sign in to comment.