-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Support simple opacity in nested text #46267
Conversation
This pull request was exported from Phabricator. Differential Revision: D61999163 |
This pull request was exported from Phabricator. Differential Revision: D61999163 |
Summary: Pull Request resolved: facebook#46267 We can propagate opacity, already part of AttributedString, to alpha channel of paint used to draw text and background on canvas. This does not support propagating to views, and contrary to the iOS example added for legacy arch I added, does not correctly support nesting opacity. This is a limitation of new arch more generally, where the information of overlapped opacity is discarded before the AttributedString is set. Bg and foreground are drawn separately with alpha as well, instead of rendering overlapping content offscreen to properly apply it (this is an issue on RN Android more generally, and existing color alpha support, but is pretty noticeable here). This impl targets new arch only. Changelog: [Android][Added] - Support simple opacity in nested text Differential Revision: D61999163
7a53592
to
654a06a
Compare
Summary: Pull Request resolved: facebook#46267 We can propagate opacity, already part of AttributedString, to alpha channel of paint used to draw text and background on canvas. This does not support propagating to views, and contrary to the iOS example added which originated with legacy arch, does not correctly support nesting opacity. This is a limitation of new arch more generally, where an AttributedString fragment only contains inner-most opacity. Bg and foreground are drawn separately with alpha as well, instead of rendering overlapping content offscreen to properly apply it (this is an issue on RN Android more generally, and existing color alpha support, but is pretty noticeable here). This impl targets new arch only. Changelog: [Android][Added] - Support simple opacity in nested text Reviewed By: alanleedev Differential Revision: D61999163
This pull request was exported from Phabricator. Differential Revision: D61999163 |
654a06a
to
40a72c3
Compare
This pull request has been merged in a2d53d5. |
This pull request was successfully merged by @NickGerleman in a2d53d5 When will my fix make it into a release? | How to file a pick request? |
Summary:
We can propagate opacity, already part of AttributedString, to alpha channel of paint used to draw text and background on canvas.
This does not support propagating to views, and contrary to the iOS example added for legacy arch I added, does not correctly support nesting opacity. This is a limitation of new arch more generally, where the information of overlapped opacity is discarded before the AttributedString is set.
This impl targets new arch only.
Changelog:
[Android][Added] - Support simple opacity in nested text
Differential Revision: D61999163