Use setPosition instead of x= to improve performance