small getRectangle optimization