How to change dimensions of existing rectangle?