update rectangle after setting origin