Replaced deprecated rect conversion methods.