Determine the click on the button by the coordinates of the click on the canvas

Hello, help me please, I just can’t figure it out. Since I am using e.preventDefault on the touchstart event, I need to programmatically determine if I pressed the button or not. For this, the button has a contains method that determines whether the passed coordinates belong to the button. I get the coordinates this way:

    document.getElementById('renderCanvas').addEventListener('touchstart', function (e) {
                            console.log(e.changedTouches[0].offsetX, e.changedTouches[0].offsetY);
console.log(backButton.contains(e.changedTouches[0].pageX, e.changedTouches[0].pageY));

I tried to pass the coordinates clientX and Y and other possible ones that are in the click event, but none of them fit, apparently because the coordinates of the button are local in relation to the container in which it is located. How do I convert the received coordinates from the event so that the contains method works as expected.

I think a repro in the PG would definitely help here.