Open liwuqingxin opened 1 month ago
When Flush happens here: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs#L70
The current transform matrix isn't in sync so I have to adjust this line: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.PendingCommands.cs#L149
by adding this:
if (Transform != _impl.Transform)
{
_impl.Transform = Transform;
}
It fixes the issue but the question is why the transforms are out of sync
Describe the bug
When I call DrawingContext.PushOpacity() and then draw text at a position other than (0,0), the transform state of DrawingContext becomes messed.
In code above, the line#2 appears at the point (100+50, 0+20) but (100,0).
To Reproduce
I have made a demo to demonstrate it. Avalonia.v11.1.0.rc2.Render.Demo.zip
Expected behavior
In the demo, a square should be drawn.
Avalonia version
11.1.0-rc2
OS
Windows
Additional context
No response