Account for the Mac's flipped coordinate system

This feels kinda hacky, but it took me a while to get it to work. And now it works. So I'm gonna leave it like this for now.