You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CompositionSpriteShape.StrokeDashArray is scaled by StrokeThickness (WinUI uses absolute units) #25199
CompositionSpriteShape.StrokeDashArray / StrokeDashOffset are multiplied by StrokeThickness when the stroke is built (the XAML Shape.StrokeDashArray convention). A ring of radius 52 with StrokeThickness = 6 and StrokeDashArray = { 4, 14 } draws 3 long dashes (dash ≈ 24, period ≈ 108) instead of 18 short ones.
This affects every LottieGen-generated animation with dashed strokes and a thickness other than 1, plus any app code that uses Composition dashes.
Expected behavior 🎯
Composition dash values are absolute (geometry units), as on WinUI / Windows App SDK: the same generated code on WinAppSDK 2.4 draws 18 dashes, dash 4, gap 14, which matches the Lottie reference. Only XAML Shape.StrokeDashArray / StrokeDashOffset are relative to StrokeThickness.
How to reproduce it (as minimally and precisely as possible) 🔬
varline=compositor.CreateLineGeometry();line.Start=newVector2(10,20);line.End=newVector2(210,20);varshape=compositor.CreateSpriteShape(line);shape.StrokeThickness=6f;shape.StrokeBrush=compositor.CreateColorBrush(Colors.Red);shape.StrokeDashCap=CompositionStrokeCap.Flat;shape.StrokeDashArray.Add(10f);shape.StrokeDashArray.Add(10f);// host it in a ShapeVisual via ElementCompositionPreview.SetElementChildVisual
WinUI: dashes alternate every 10px. Uno: they alternate every 60px.
Workaround 🛠️
Divide Composition dash values by StrokeThickness on Uno only (not WinUI-correct). For Lottie content, avoid dashes or use stroke width 1.
Affected platforms 📱💻🖥️
All platforms 🌍 (Skia and managed/WebGPU drawing backends)
Uno.Sdk version (and other relevant versions) 📦
Uno.Sdk 7.0 dev builds (current master); LottieGen 8.2.250604.
IDE version 🧑💻
N/A
Anything else we need to know? 💬
The scaling lives in the backend strokers (SkiaGeometrySource2D.Stroke.cs, ManagedGeometry.Stroke.cs), so XAML Shape relies on it implicitly and ManagedSvg divides by the stroke width to compensate.
Activity
fix(composition): Dash the trimmed path, not the whole one
fix(composition): Match WinUI's dash origin on ellipses
fix(shapes): Match WinUI dash scale and figure starts
fix(composition): Use absolute units for StrokeDashArray
fix(composition): Dash the trimmed path, not the whole one
fix(composition): Match WinUI's dash origin on ellipses
fix(shapes): Match WinUI dash scale and figure starts