Skip to content

Fix StreamGeometry Clone and Open when a Transform is set - #22303

Merged
MrJul merged 5 commits into
AvaloniaUI:mainfrom
Evan260:fix-streamgeometry-transform-clone-open
Oct 7, 2026
Merged

MrJul merged 5 commits into
AvaloniaUI:mainfrom
Evan260:fix-streamgeometry-transform-clone-open

Conversation

@Evan260

@Evan260 Evan260 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What does the pull request do?

Another go at #22213, which was reverted in #22294 because it broke the color picker icons.

Once a geometry has a Transform, Clone() and Open() don't get the object they expect, so they threw. The first attempt got around that by using a private field, but PathGeometry never draws that field, so cloning one gave back an empty shape and the icons came out blank.

This one takes the geometry back out of the transform wrapper instead, so PathGeometry keeps working. Clone() also keeps the Transform, as GeometryGroup and PolylineGeometry do.

Render tests

Four now. Two fail on main, and two fail on the reverted commit, including a stretched PathGeometry like the color picker icons. Those last two are what was missing last time.

Fixed issues

Fixes #21494

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

NuGet packages

The packages for this pull request have been published (workflow run):

@MrJul MrJul added bug backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 25, 2026
@MrJul MrJul self-assigned this Oct 6, 2026
MrJul added a commit to MrJul/Avalonia that referenced this pull request Oct 6, 2026

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some issues with this PR, see the comments.

@MrJul

MrJul commented Oct 6, 2026

Copy link
Copy Markdown
Member

The added render tests are nice! I've added them to #22247, which is imo a proper solution to the issue but requires heavier changes. Meanwhile, we can merge this PR (once issues are resolved).

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrJul
MrJul added this pull request to the merge queue Oct 7, 2026
Merged via the queue into AvaloniaUI:main with commit 2d86da9 Oct 7, 2026
11 checks passed
@Evan260
Evan260 deleted the fix-streamgeometry-transform-clone-open branch October 7, 2026 19:11
MrJul pushed a commit that referenced this pull request Oct 9, 2026
* Add render tests for StreamGeometry Clone and Open with a Transform

* Fix StreamGeometry Clone and Open when a Transform is set

* Add tests for when a geometry reports that its drawing changed

* Report the change when the drawing finishes, and let PathGeometry.Open add figures

* Remove the comments and revert the interface type
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when cloning StreamGeometry with Transform

2 participants