-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
fix(line): soft clipping gradient. #15711
Conversation
Thanks for your contribution! The pull request is marked to be |
@plainheart Yes, the leaking issue is hard to be totally eliminated because of the limitation of the canvas gradient. |
大佬牛逼 |
@plainheart I did some search on how skia draws the gradient with One way to solve this issue I can think of is to split the gradient into multiples and draw them on a full-width canvas. Then use this canvas as a CanvasPattern. |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
In the cases like #15680. The coordinates range of gradient objects is very large. Which leads to blurry transition when GPU acceleration is enabled in chrome. Only version 5.1 doesn't have this issue because we clamped the data. But it will cause infinite value wrong appearance. So in this PR #15416 we removed the clamping and this blurry issue appears again.
In this PR. I clamp the color stops and recalculate the clamped color in
LineView.ts
. It should fix both issues mentioned above.Fixed issues
#15680
Details
Before: What was the problem?
After: How is it fixed in this PR?
Misc
Related test cases or examples to use the new APIs
NA.
Others
Merging options
Other information