update rectangle under the control of ratio

update rectangle under the control of ratio