proportionOfWidth (proportionalRect.h));
should be
proportionOfHeight (proportionalRect.h));
Thank you!