Refactor SetPosition: allow to set only vertical or horizontal positon of rect