Okey, so I figured out the problem. I have two seperate if-statements, where one sets the xy-value if a parameter is changed, and the other sets the parameter if a xy-value is changed. This way they work mutual, but I fear my implementation of this is not the best.
Do you have any suggestion how to improve this?