constraining x and y to stage width and height