We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DrawingContext continues to apply transformation after its state is disposed
The following control draws Pink rectange at wrong position, (300, 300) instead of (100 ,100):
using Avalonia; using Avalonia.Controls; using Avalonia.Media; namespace AvaloniaTransformBug; public partial class CustomControl : UserControl { public CustomControl() { InitializeComponent(); } public override void Render(DrawingContext context) { using (var clipState = context.PushClip(Bounds)) { using (var optionsState = context.PushRenderOptions(new RenderOptions { EdgeMode = EdgeMode.Aliased })) { using (var transformState = context.PushTransform(Matrix.CreateTranslation(200, 200))) { context.FillRectangle(Brushes.Goldenrod, new Rect(0, 0, 100, 100)); } } using (var optionsState = context.PushRenderOptions(new RenderOptions { EdgeMode = EdgeMode.Aliased })) { context.FillRectangle(Brushes.DeepPink, new Rect(100, 100, 50, 50)); } } } }
Window:
<Window xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:AvaloniaTransformBug" x:Class="AvaloniaTransformBug.MainWindow" Title="AvaloniaTransformBug"> <local:CustomControl x:Name="Renderer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="20" /> </Window>
The Pink rectangle drawns at excepted position
11.1.2-rc1
Windows
Actual behaviour
Excepted behaviour
The text was updated successfully, but these errors were encountered:
PR #16363 solve the issue.
Sorry, something went wrong.
kekekeks
Gillibald
Successfully merging a pull request may close this issue.
Describe the bug
DrawingContext continues to apply transformation after its state is disposed
To Reproduce
The following control draws Pink rectange at wrong position, (300, 300) instead of (100 ,100):
Window:
Expected behavior
The Pink rectangle drawns at excepted position
Avalonia version
11.1.2-rc1
OS
Windows
Additional context
Actual behaviour
Excepted behaviour
The text was updated successfully, but these errors were encountered: