Why is Window.bounds relative to bottom left?

At the risk of asking a very basic stupid question - why is Window.bounds relative to bottom left?

When making GUIs in a View everything flows from top left, and that feels intuitive. In the western world most things flow from the top left. Still Window.bounds wants a Rect where the second argument is “bottom”, even though Rect itself names that argument as “top”.

Purely historical. It was that way in the old Cocoa SuperCollider.app – probably not intentionally so. I’m guessing it’s just that this is the way Cocoa represented screen coordinates, and James McCartney didn’t flip the Y axis to be top down. It would be a fair argument to say that was a mistake, but that’s how it shook out.

The Qt GUI, sensibly, doesn’t follow the Cocoa convention – screen coordinates are measured from top left. But there’s a lot of user code that would position windows incorrectly if we flipped Y back to the way that makes sense. So… we’re kind of stuck with it.

hjh

Thanks James, that puts my mind at ease :slight_smile:

Maybe flipping back the Y would be a change to consider for SC4.

1 Like

Yes this drives me nuts.

Maybe we could make a new class Mᴉupoʍ that does it right?

(or just Win)

3 Likes