I have added a NSWindow child to a main NSWindow to simulate a NSDrawer (since it has been deprecated).
Then I animate the drawer to the left/right to open/close it. It works well. Since I need only 2 rounded corners I have setup two conditions: when the drawer opens to the right side of the main window and when it opens to the left side.
It works well at the first settings. If I later change side, as I change the maskedCorners as shown here above, I still see the drawer with the proper rounded corners but I also see an unwanted tiny dark "squared" border around the window, even close to the rounded corners.
How can I update the layer to properly show the rounded corners without that squared border around the whole window?
Code Block [mainWindow addChildWindow:drawer ordered:NSWindowBelow]; drawer.contentView.wantsLayer = YES; drawer.contentView.layer.backgroundColor = [NSColor clearColor].CGColor; drawer.contentView.layer.masksToBounds = YES; drawer.contentView.layer.cornerRadius = 10.0;
Then I animate the drawer to the left/right to open/close it. It works well. Since I need only 2 rounded corners I have setup two conditions: when the drawer opens to the right side of the main window and when it opens to the left side.
Code Block if(drawer.mSide == kSideRight){ drawer.contentView.layer.maskedCorners = kCALayerMaxXMinYCorner | kCALayerMaxXMaxYCorner; } else{ drawer.contentView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner; }
It works well at the first settings. If I later change side, as I change the maskedCorners as shown here above, I still see the drawer with the proper rounded corners but I also see an unwanted tiny dark "squared" border around the window, even close to the rounded corners.
How can I update the layer to properly show the rounded corners without that squared border around the whole window?