The code was only working for me on 1080 resolution. I solved it by dividing these values by the viewport scale.
Moreover, I won’t use it for now, but I think the angle is inversed. I mean, the image I use as indicator is focusing outside when it’s on the x edges, while it’s focusing inside when it’s on the y edges.