Skip to content

CompositionGeometry.TrimEnd defaults to 0 and TrimEnd = 0 draws the whole path #25200

Closed

Description

@MartinZikmund

Current behavior 🐛

CompositionGeometry.TrimEnd defaults to 0 on Uno, and a geometry with TrimStart = TrimEnd = TrimOffset = 0 is treated as "untrimmed", so an explicit TrimEnd = 0 draws the whole path. A geometry that only sets TrimStart (leaving TrimEnd at its default) draws nothing.

A LottieGen trim-path animation whose end keyframe is 0 (a draw-on from nothing — checkmarks, loaders, the determinate ProgressRing at value 0) therefore flashes the full stroke at progress 0, at loop wrap and after Stop.

Expected behavior 🎯

Match WinUI / Windows App SDK: CreateEllipseGeometry() reports TrimStart = 0, TrimEnd = 1, TrimOffset = 0 at runtime (probed on WinAppSDK 2.4; the Microsoft Learn page says the TrimEnd default is 0, but the runtime reports 1). An empty trim window (TrimEnd == TrimStart, including 0, 0) draws nothing.

How to reproduce it (as minimally and precisely as possible) 🔬

var ellipse = compositor.CreateEllipseGeometry();
ellipse.Center = new Vector2(50, 50);
ellipse.Radius = new Vector2(40, 40);
Debug.WriteLine(ellipse.TrimEnd); // WinUI: 1, Uno: 0

ellipse.TrimEnd = 0f;              // WinUI: nothing drawn, Uno: full ring
var shape = compositor.CreateSpriteShape(ellipse);
shape.StrokeThickness = 8f;
shape.StrokeBrush = compositor.CreateColorBrush(Colors.Red);

Workaround 🛠️

Keep trim-end keyframes slightly above 0 (e.g. 0.5%), and always set TrimEnd explicitly when setting TrimStart.

Affected platforms 📱💻🖥️

All platforms 🌍

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? 💬

CompositionSpriteShape.TryResolveTrim and the native-stroking fast path both use all-zero as the "no trim" sentinel.

Activity

  1. added
    kind/bug
    triage/untriaged
    on Oct 10, 2026
  2. added
    7.1
    on Oct 14, 2026
  3. added 2 commits that reference this issue on Oct 14, 2026
    fb1aaf6
    e7cbe80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

7.1kind/bugtriage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions