Improve rectangle conversion for Mac