Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Status Bar When building with the macOS SDK included with macOS Sonoma, ares has had a regression involving an overly large status bar that rendered over the game viewport, causing confusion as well as being tricky to debug. It turns out that this was due to a breaking change in AppKit in macOS 14 where an `NSView`'s `dirtyRect` was no longer clipped to its bounds by default. In short, a view's `dirtyRect` is now often much larger than its `bounds` if `clipsToBounds` is not defined explicitly. This creates problems in views that draw by calling `NSFillRect` on the dirtyRect, a common pattern, as it will fill a rect that is much larger than the actual bounds. This PR sets the `clipsToBounds` property for NSView to `true` for views in ares that draw by filling `dirtyRect`. Accordingly these views' `dirtyRect` will now always be the same size as their `bounds`. This was true of `canvas.cpp`, `viewport.cpp`, and `label.cpp`. To avoid making the change overly broad, and to enable macOS to perform whatever optimizations it wants to perform, other view types are left alone. ### Splash Screen This PR also addresses logo clipping issues in macOS on the splash screen. The dimensions for the logo on the splash screen, as defined, seemed to be a bit off previously, with the square logo rendering into a non-square canvas area. For whatever reason, this only clipped the logo rendering on macOS. The size and padding are adjusted slightly by this PR. It should not result in regressions on other platforms, but should be tested to make sure. > [!IMPORTANT] > Pwease test on Windows and Linux to make sure the splash screen looks OK. macOS screenshot of adjusted splash screen and fixed status bar, built with Xcode 15: <img width="1072" alt="Screenshot 2024-03-02 at 1 43 20 AM" src="https://github.com/ares-emulator/ares/assets/6864788/83504592-03dd-4881-8f3d-0db1fb771f44"> --------- Co-authored-by: jcm <[email protected]>
- Loading branch information