Make drawing rectangle fully work on Mac/Safari