Skip to content

Fix Clip ContentPresenter, TemplatedControl, and ExperimentalAcrylicBorder to rounded bounds - #22015

Open
zrt2399 wants to merge 1 commit into
AvaloniaUI:mainfrom
zrt2399:fix_issue_21998
Open

Fix Clip ContentPresenter, TemplatedControl, and ExperimentalAcrylicBorder to rounded bounds#22015
zrt2399 wants to merge 1 commit into
AvaloniaUI:mainfrom
zrt2399:fix_issue_21998

Conversation

@zrt2399

@zrt2399 zrt2399 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What does the pull request do?

Adds rounded ClipToBounds behavior to all controls with a CornerRadiusProperty, including ContentPresenter, TemplatedControl, and ExperimentalAcrylicBorder, keeping their behavior consistent with the existing Border implementation.

What is the current behavior?

image
    <StackPanel Margin="20" Spacing="20">
        <ContentControl ClipToBounds="True" CornerRadius="20">
            <Rectangle Height="20" Fill="Blue" />
        </ContentControl>
        <ContentPresenter ClipToBounds="True" CornerRadius="20">
            <ContentPresenter.Content>
                <Rectangle Height="20" Fill="Blue" />
            </ContentPresenter.Content>
        </ContentPresenter>
        <Border ClipToBounds="True" CornerRadius="20">
            <Rectangle Height="20" Fill="Blue" />
        </Border>
        <ExperimentalAcrylicBorder ClipToBounds="True" CornerRadius="20">
            <Rectangle Height="20" Fill="Blue" />
        </ExperimentalAcrylicBorder>
    </StackPanel>

What is the updated/expected behavior with this PR?

image

Checklist

Fixed issues

Fixes #21998

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068477-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added bug backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClipToBounds does not respect CornerRadius on ContentControl, ContentPresenter, and ExperimentalAcrylicBorder; only Border works

3 participants