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 #1081

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
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 @@ -156,6 +156,9 @@ public static int VERSION (int major, int minor, int bugfix) {
public static final long sel_setStyle = Selector.sel_setStyle.value;
public static final int NSTableViewStylePlain = 4;

/** 14.0 selector */
public static final long sel_setClipsToBounds_ = Selector.sel_setClipsToBounds_.value;

/* AWT application delegate. Remove these when JavaRuntimeSupport.framework has bridgesupport generated for it. */
public static final long class_JRSAppKitAWT = objc_getClass("JRSAppKitAWT");
public static final long sel_awtAppDelegate = Selector.sel_awtAppDelegate.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public enum Selector {
/** 11.0 selector */
, sel_setStyle("setStyle:")

/** 14.0 selector */
, sel_setClipsToBounds_("setClipsToBounds:")

, sel_awtAppDelegate("awtAppDelegate")

/** This section is auto generated */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,13 @@ void drawRect (long id, long sel, NSRect rect) {
if (!isDrawing()) return;
Display display = this.display;
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);

display.isPainting.addObject(view);
NSGraphicsContext context = NSGraphicsContext.currentContext();
context.saveGraphicsState();
Expand Down
Loading