Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Mac drawing bug issue 1012 part 2 #1232

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,11 @@ boolean setMarkedText_selectedRange (long id, long sel, long string, long range)
void setNeedsDisplay (long id, long sel, boolean flag) {
if (flag && !isDrawing()) return;
NSView view = new NSView(id);
/*
* Since macOS 14 the clipsToBounds property of NSView has to be set to true
* See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14
*/
OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true);
if (flag && display.isPainting.containsObject(view)) {
NSMutableArray needsDisplay = display.needsDisplay;
if (needsDisplay == null) {
Expand All @@ -2121,6 +2126,11 @@ void setNeedsDisplayInRect (long id, long sel, long arg0) {
NSRect rect = new NSRect();
OS.memmove(rect, arg0, NSRect.sizeof);
NSView view = new NSView(id);
/*
* Since macOS 14 the clipsToBounds property of NSView has to be set to true
* See https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-14
*/
OS.objc_msgSend(id, OS.sel_setClipsToBounds_, true);
if (display.isPainting.containsObject(view)) {
NSMutableArray needsDisplayInRect = display.needsDisplayInRect;
if (needsDisplayInRect == null) {
Expand Down
Loading