I am use XCode 15.2 and macOS SDK 14.2.
I placed an NSView inside the NSClipView of an NSScrollView, the NSView is smaller than the NSClipView, always centered.
On Ventura, regardless of whether clipsToBounds is set, the bounds and visibleRect of the NSView are the same.
However, on Sonoma, even after overriding
-(BOOL)clipsToBounds
{
return YES;
}, the bounds is correct, but the visibleRect (the red rect) is still the same size as the NSClipView, results in the text is not clipped.
Am I missing something or doing something wrong?
How can I make the visibleRect of the NSView consistent with its bounds?