Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed TextBlock disappearing when inline used and measure is invalidated #17875

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adirh3
Copy link
Contributor

@adirh3 adirh3 commented Jan 2, 2025

What does the pull request do?

Fixes an issue that TextBlock with inlines could disappear when it's measure is invalidated.

What is the current behavior?

Invalidating a TextBlock measure with inlines could cause the TextBlock to disappear.
This can be reproduced by going into ControlCatalog/TextBlockPage and then changing Avalonia's theme -
image

What is the updated/expected behavior with this PR?

The TextBlock should not disappear when it's measure is invalidated.

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

Recalculate _textRuns in the next measure/render after it is set to null by OnMeasureInvalidated.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link

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

@timunie
Copy link
Contributor

timunie commented Jan 2, 2025

Does it fix #17862 ?

@adirh3
Copy link
Contributor Author

adirh3 commented Jan 3, 2025

Does it fix #17862 ?

Checked with their repro, didn't fix it.

@Gillibald
Copy link
Contributor

Please add a failing unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants