Repository navigation
Closed
Labels
difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIhas-repro-branchkind/bugSomething isn't workingplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/shapes-brushes 🔶Categorizes an issue or PR as relevant to shapes and brushes
Description
Current behavior
The rendering of the path objects is not done correctly in WASM (untested on other platforms). It looks like this:
Expected behavior
It should render the same as UWP, i.e. like this:
How to reproduce it
Create a user control with the following XAML content:
<UserControl
x:Class="iRatio.Client.Icon"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<Viewbox>
<Canvas Name="layer1" Width="53" Height="53">
<Canvas Name="g958">
<Canvas.RenderTransform>
<MatrixTransform Matrix="1.1048446, 0, 0, 1.1959561, -67.035883, -96.098854"/>
</Canvas.RenderTransform>
<Canvas Name="g920">
<Canvas.RenderTransform>
<TranslateTransform X="3.6170566" Y="26.121871"/>
</Canvas.RenderTransform>
<Path Name="path882" Fill="#FFFFFFFF" Data="m 89.844925 86.908932 -5.484915 -9.50015 -5.484913 -9.500149 10.969828 -10e-7 10.969825 0 -5.484911 9.50015 z">
<Path.RenderTransform>
<MatrixTransform Matrix="0.99974084, 0, 0, 1.0590767, 0.02096173, -5.1400261"/>
</Path.RenderTransform>
</Path>
<Path Name="path8822" Fill="#FFFFFFFF" Data="m 71.890129 -67.818339 -5.484914 -9.500151 -5.484915 -9.50015 10.969829 0 10.969829 -10e-7 -5.484915 9.500151 z">
<Path.RenderTransform>
<MatrixTransform Matrix="0.99974084, 0, 0, -1.0590767, 0.02096173, -5.0997423"/>
</Path.RenderTransform>
</Path>
</Canvas>
<Rectangle Canvas.Left="68.170586" Canvas.Top="85.901428" Width="38.119644" Height="2.9399648" Name="rect9016" Fill="#FFFFFFFF"/>
<Rectangle Canvas.Left="62.953873" Canvas.Top="117.08479" Width="38.119358" Height="2.9422779" Name="rect90161" Fill="#FFFFFFFF"/>
</Canvas>
</Canvas>
</Viewbox>
</Grid>
</UserControl>
Environment
Nuget Package:
- Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
- Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
- Uno.SourceGenerationTasks
- Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
- Other:
Nuget Package Version(s):
Uno.UI.WebAssembly: v3.3.0
Affected platform(s):
- iOS
- Android
- WebAssembly
- WebAssembly renderers for Xamarin.Forms
- macOS
- Skia
- WPF
- GTK (Linux)
- Tizen
- Windows
- Build tasks
- Solution Templates
IDE:
- Visual Studio 2017 (version: )
- Visual Studio 2019 (version: 16.8)
- Visual Studio for Mac (version: )
- Rider Windows (version: )
- Rider macOS (version: )
- Visual Studio Code (version: )
Metadata
Metadata
Assignees
Labels
difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIhas-repro-branchkind/bugSomething isn't workingplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/shapes-brushes 🔶Categorizes an issue or PR as relevant to shapes and brushes


Activity
jeromelaban commentedon Nov 19, 2020
Note for contributors
Here's a playground sample: https://playground.platform.uno/#9e419e77
The second shape does not appear, yet is present in the DOM.
Update: There are issues:
m 71.890129 -67.818339 -5.484914 -9.500151 -5.484915 -9.50015 10.969829 0 10.969829 -10e-7 -5.484915 9.500151 zdoes not show anything useful. Could be related to a difference in interpretation of the XAML path spec and the SVG path spec.Canvascontrols is behaving incorrectly, this could be related to the measuring of canvas elements.mikernet commentedon Nov 20, 2020
The two rectangles on the bottom are also not rendering and they seem to be lacking any spacial info in the DOM such as width, height, or coordinates within the
Canvasfor some reason.jeromelaban commentedon Nov 20, 2020
@mikernet as a workaround for this issue, can you merge all the layers into one path ? Also, how did you create this Xaml ?
mikernet commentedon Nov 20, 2020
We generate XAML from our SVG files using Inkscape. There's a lot of them and some are more complex than others. I don't know enough about path syntax at the moment to be hand manipulating them and I imagine the various transforms might make that a bit of a challenge.
jeromelaban commentedon Nov 20, 2020
Thanks, this will help reproducing those issues.
jeromelaban commentedon Nov 20, 2020
Note that you can use SVG directly for Wasm and UWP now.
mikernet commentedon Nov 20, 2020
Using the SVG file directly was a horrible fail so I don't know what's going on there, renders it entirely wrong in UWP.
EDIT: Seems that a lot of people have issues with UWPs SVG renderer so I'm not going to hold my breath there, haha.
mikernet commentedon Nov 21, 2020
There are obviously still underlying issues that need to be resolved, but with the motivation of @jeromelaban 's suggestion to merge layers into one path, I played around with Inkscape to see what I could do. This works to merge simple one-color SVG icons in Inkscape into a single path that renders correctly:
When I exported that to XAML, the above user control could be reduced to this, which renders just fine:
7 remaining items
test: Reproduce paths in Canvas with MatrixTransform rendering issue
MartinZikmund commentedon Apr 7, 2026
Repro generator
Runtime test(s) added in branch
dev/mazi/repro/4563:src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Shapes/Given_Path.cs→When_Paths_In_Canvas_With_MatrixTransform_Render_Without_ExceptionMatrixTransformandTranslateTransformrender without exceptions and have non-zero size. The original visual mismatch was on WASM (DOM-based rendering path). The branch provides a regression guard for the Skia path and ensures the XAML structure parses correctly.morning4coffe-dev commentedon May 31, 2026
Seems to be fixed with the referenced changes
test: Reproduce paths in Canvas with MatrixTransform rendering issue
test: Reproduce paths in Canvas with MatrixTransform rendering issue
test: Reproduce paths in Canvas with MatrixTransform rendering issue
test: Reproduce paths in Canvas with MatrixTransform rendering issue
test: Reproduce paths in Canvas with MatrixTransform rendering issue