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

The layout of visual affects VisualBrush results. #18033

Open
kkwpsv opened this issue Jan 23, 2025 · 0 comments
Open

The layout of visual affects VisualBrush results. #18033

kkwpsv opened this issue Jan 23, 2025 · 0 comments
Assignees

Comments

@kkwpsv
Copy link
Contributor

kkwpsv commented Jan 23, 2025

Describe the bug

The layout of visual (the position at its parent, e.g. margin) affects VisualBrush results.
In WPF, it's not.

To Reproduce

<UniformGrid Columns="3" Height="200">
  <Rectangle x:Name="Rectangle0" Fill="Red" Margin="20"/>
  <Rectangle x:Name="Rectangle1" Margin="20"/>
</UniformGrid>
Rectangle1.Fill = new VisualBrush(Rectangle0);

Same code in Avalonia and WPF.

Avalonia result:
Image

WPF result:

Image

Expected behavior

The behavior in WPF.

Avalonia version

11.2.3

OS

No response

Additional context

No response

@kkwpsv kkwpsv added the bug label Jan 23, 2025
@Gillibald Gillibald self-assigned this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants