Skip to content

Fix RadialGradientBrush GradientStop reordering #18907

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

Gillibald
Copy link
Contributor

What does the pull request do?

This PR makes sure gradient stops are correctly reordered when the center and origin are not the same.

What is the current behavior?

Currently, under some conditions gradient stops do not have a valid value after reordering because of some rounding error, etc.

What is the updated/expected behavior with this PR?

I have added some validation to the ImmutableGradientStop ctor so offsets are always valid. The Skia RadianGradientBrush creation was adjusted to avoid rounding errors. A proper condition for rerordering was added and the optional reordering was optimize to avoid Linq

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

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link

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

@grokys grokys added the bug label May 26, 2025
@grokys grokys added this pull request to the merge queue May 26, 2025
@Gillibald Gillibald added the backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch label May 26, 2025
Merged via the queue into AvaloniaUI:master with commit 0b87d23 May 26, 2025
11 checks passed
Gillibald added a commit to Gillibald/Avalonia that referenced this pull request May 27, 2025
Gillibald added a commit to Gillibald/Avalonia that referenced this pull request May 27, 2025
Gillibald added a commit to Gillibald/Avalonia that referenced this pull request May 27, 2025
@maxkatz6 maxkatz6 added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels May 27, 2025
maxkatz6 pushed a commit that referenced this pull request May 27, 2025
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.

4 participants