NSRect vs CGRect: y-axis inversion
问题 So I'm trying to convert an NSRect to a CGRect. I used NSRectToCGRect() which copies everything over finely, but does not take into account y-origin axis. The problem: A CGRect origin of (0,0) is the top left. NSRect origin (0,0) is bottom left. Thus an NSRect (0,0,100,100) box is positioned at the bottom left of your screen, while a CGRect (0,0,100,100) box is placed at the top left of your screen. I have a hack that fixes the y-origin through basic math: fixedOriginY = screenHeight - NSRect