Rounded border: corner radius cuts border outline off
See original GitHub issueHey, I’m trying to create a borderless window with custom decoration. I decided to use a rounded border for this, for example:
<Border CornerRadius="20"
BorderBrush="Gray"
BorderThickness="2"
ClipToBounds="True">
<!-- Content -->
</Border>
Unfortunately, the corner radius cuts the gray border outline off:
Is it possible to outline along the actual (rounded) boundary if a corner radius is set?
Also, I noticed that the border edges look really pixelated. Is there a way to enable anti-aliasing for elements with the CornerRadius
property in the rendering engine?
Some general system information:
Version | 0.10.0-preview6 |
Host | Arch Linux 5.8.12-arch1-1 (X11) |
NET Core SDK | 3.1.108 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Border is cutting off when using border-radius?
I have an image which has a 5px border around it and I wanted to round the corners of both the image and...
Read more >border-radius - CSS: Cascading Style Sheets - MDN Web Docs
The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, ......
Read more >Don't fail 1px outlines and rounded shapes · Issue #2222 · ...
In rounded corners using border-radius, the corner bits are no longer part of the component, by any reasonable definition of the component. And ......
Read more >border-radius
The border-radius property takes between one and four length or percentage values, where one value sets the radius for all four corners at...
Read more >SwiftUI Tip: How to Draw a Border with Rounded Corners
With SwiftUI, you can easily draw a border around a button or text (and it actually works for all views) using the border...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Solved it by applying a small padding to the border element content to avoid overlaps with the rounded window border. Here’s my solution if anyone else runs into this issue:
so i read about a bit and it says to do it in the App Builder like
.With(new Win32PlatformOptions { CompositionBackdropCornerRadius = 30})
if that is right it is still not working, is there anything else i need to add?Also im not sure if it matters but i am also using Material avalonia for styling.