On android and iOS if you scale view and get relative coords, they will act like they were not scaled at all. Let's say that we have a square with size 100x100. If you click in the middle, x and y fields in event will both be 50. Now, if you scale this view by 2 (i.e. new size is 200x200) and click in the middle, you'll still get values of 50.
Web takes scale into account and on the above situation, second output would be 100. To unify this behavior we now divide coords by scale factors.
Test plan
Add console.log(e.x, e.y) in any example with scale, for example in transformations
Description
On
android
andiOS
if you scale view and get relative coords, they will act like they were not scaled at all. Let's say that we have a square with size100x100
. If you click in the middle,x
andy
fields in event will both be50
. Now, if you scale this view by 2 (i.e. new size is200x200
) and click in the middle, you'll still get values of 50.Web takes scale into account and on the above situation, second output would be
100
. To unify this behavior we now divide coords by scale factors.Test plan
Add
console.log(e.x, e.y)
in any example with scale, for example intransformations