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

Mac: Control bezel clipping #2303

Closed
cyanfish opened this issue Sep 4, 2022 · 1 comment · Fixed by #2505
Closed

Mac: Control bezel clipping #2303

cyanfish opened this issue Sep 4, 2022 · 1 comment · Fixed by #2505
Labels
Milestone

Comments

@cyanfish
Copy link
Contributor

cyanfish commented Sep 4, 2022

On macOS 12.5.1 with Eto 2.7.1, the edges of buttons and other controls are cut off. This can be seen in the Eto test app (e.g. Eto.Test.macOS).

Example 1 (all 4 sides):
example
Example 2 (right side):
example2

Looking at the readme screenshot there's a little bit but not as bad as this. I couldn't get older Eto versions working so I'm not sure if it's a regression or an issue with the latest macOS version.

The issue seems to be that the bezel renders outside the control's frame and is clipped at the edges of the layout's NSBox. So some edges look okay and some don't depending on the position in the layout. Putting everything in a tablelayout with 1-2px padding fixes it but obviously that's not a great solution.

I've experimented a bit with trying to fix it (e.g. WantsLayer = true, MasksToBounds = false, WantsDefaultClipping = false on MacEventView) but with no success yet.

@cwensley cwensley added the bug label Jun 26, 2023
@cwensley cwensley added this to the 2.8.x milestone Jun 26, 2023
@cwensley
Copy link
Member

Hey @cyanfish, thanks for reporting the issue.

There's a few things causing this. First, Eto uses the alignment rect for control size/alignment so things line up correctly. However, macOS likes to draw things outside this alignment rect, which is getting clipped to the containing view unless it has padding directly. I found some WWDC notes that has this interesting tidbit:
Screenshot 2023-06-26 at 10 14 32 AM

In particular, the part about the clipsToBounds property, which is exactly what we need. I'm working on getting this fixed up now.

cwensley added a commit to cwensley/Eto that referenced this issue Jun 26, 2023
@cwensley cwensley modified the milestones: 2.8.x, 2.8.0 Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants