button: invert touchCoords y-axis for consistency with xy pads

This commit is contained in:
jean-emmanuel 2021-12-05 16:41:39 +01:00
parent 5371989084
commit 8167f2c588

View file

@ -193,7 +193,7 @@ class Button extends Widget {
if (this.exposeTouchCoords) {
if (options.y !== undefined) {
this.parsersLocalScope.touchCoords = [options.x / this.buttonSize[0], options.y / this.buttonSize[1]]
this.parsersLocalScope.touchCoords = [options.x / this.buttonSize[0], 1 - options.y / this.buttonSize[1]]
}
}