fix bug in getPosition() method in rect.h