I build an editor window with UIToolkit and it has zoom effect like what shader graph has. In previous versions on Unity, I mean 2021.1 and earlier I used
MouseDownEvent.localMousePosition and it worked perfect in scaling but now I updated my project to 2021.2.7 and I think there is problem here.
MouseDownEvent.localMousePosition return zero when there is even a slight scaling and also
visualElement.WorldToLocal(MouseDownEvent.mousePosition) have the same effect. Even I tested
transform.matrix.inverse * MouseDownEvent.mousePosition and still it returns zero.
Can anyone please tell me what I’m doing wrong here? Thanks