Skip to content

Fix MeasureCore when there's a size constraint and there's a negative…#18462

Merged
MrJul merged 2 commits into
AvaloniaUI:masterfrom
appel1:issue18124
May 31, 2025
Merged

Fix MeasureCore when there's a size constraint and there's a negative…#18462
MrJul merged 2 commits into
AvaloniaUI:masterfrom
appel1:issue18124

Conversation

@appel1

@appel1 appel1 commented Mar 17, 2025

Copy link
Copy Markdown
Contributor

… margin.

What does the pull request do?

Fixes size of layoutable when there's a size constraint and negative margin.

What is the current behavior?

The layoutables desired size becomes smaller than expected.

Fixed issues

Fixes #18124

@avaloniaui-bot

Copy link
Copy Markdown

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

@MrJul MrJul added the bug label Mar 17, 2025
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.0.999-cibuild0056354-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.

Thanks! It didn't make sense that clamping to the maximum values was done before adding margins, but clamping to the minimum ones (0) was done after.

However, I'm a bit wary of unexpected changes that might not be caught by existing unit tests. MeasureCore is pretty critical! As such, this change is unlikely to be backported to 11.3.

@MrJul MrJul added this pull request to the merge queue May 31, 2025
Merged via the queue into AvaloniaUI:master with commit 66a8d1b May 31, 2025
10 checks passed
BrycensRanch pushed a commit to BrycensRanch/FreeBSD-Avalonia that referenced this pull request Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative margins does not behave as expected when there's a size constraint

3 participants