Skip to content

Fix - Invalidate image measure when DrawingImage source invalidates - #22028

Merged
MrJul merged 10 commits into
mainfrom
fix/image_source_invalidate
Aug 25, 2026
Merged

MrJul merged 10 commits into
mainfrom
fix/image_source_invalidate

Conversation

@emmauss

@emmauss emmauss commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What does the pull request do?

This PR invalidates an image when an IAffectsRender source invalidates.

What is the current behavior?

DrawingImage sources can change bounds when their geometry changes. Image assumes a fixed size for their sources, so when a drawing image invalidates, the image renders the new geometry with the old bounds.

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #21869

@emmauss emmauss added the bug label Aug 20, 2026
@MrJul MrJul added the backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch label Aug 20, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068619-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Comment thread src/Avalonia.Controls/Image.cs Resolved
@jsuarezruiz jsuarezruiz self-assigned this Aug 24, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068665-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Comment thread src/Avalonia.Controls/Image.cs Resolved
Comment thread src/Avalonia.Base/Visual.cs Resolved
@MrJul MrJul self-assigned this Aug 25, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068760-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@emmauss
emmauss force-pushed the fix/image_source_invalidate branch from 21eb982 to bf3ef1a Compare August 25, 2026 11:11
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068766-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Comment thread src/Avalonia.Controls/Image.cs Resolved
@emmauss emmauss changed the title Fix - Invalidate image measure when IAffectsRender source invalidates Fix - Invalidate image measure when DrawingImage source invalidates Aug 25, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068784-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@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 enabled auto-merge August 25, 2026 14:39
@MrJul
MrJul dismissed jsuarezruiz’s stale review August 25, 2026 14:40

Changes have been made.

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068804-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 27667c7 Aug 25, 2026
10 checks passed
@MrJul
MrJul deleted the fix/image_source_invalidate branch August 25, 2026 18:21
MrJul pushed a commit to MrJul/Avalonia that referenced this pull request Sep 2, 2026
…valoniaUI#22028)

* invalidate image measure when IAffectsRender source invalidates

* compare drawing image bounds when checking for measure invalidation

* addressed nit

* use dispatcher run overload in test

* gate subscription behind attachment

* fix typo

* add one more attached check

* nit if  style
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 2, 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.

Image need to invalidate measure, when Source IImage invalidated.

4 participants