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

Fix GH-41226 #45999

Closed
wants to merge 1 commit into from
Closed

Fix GH-41226 #45999

wants to merge 1 commit into from

Conversation

knappam
Copy link
Contributor

@knappam knappam commented Aug 13, 2024

When not drawing a border, the mGapBetweenPaths adjustment can create noticeable pixelation when drawing curves through a low number of pixels. This is noticeable mostly on buttons and such on low-dpi devices. This fix only applies the fix if clipping for the border radius is done.

Summary:

When drawing small radius rounded backgrounds (e.g. to draw a circle or button) we see visible pixelation. This is particularly noticable on low DPI devices.

Changelog:

[ANDROID] [FIXED] - Don't use mGapBetweenPaths if not drawing a border

Test Plan:

Built an android app that directly uses ReactViewBackgroundDrawable to draw a background and verified repro of this issue.
Screenshot from 2024-08-12 23-37-25
Then modified the code according to this PR and verified that anti-aliasing is appropriately applied
Screenshot from 2024-08-12 23-43-14

@facebook-github-bot
Copy link
Contributor

Hi @knappam!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@analysis-bot
Copy link

analysis-bot commented Aug 13, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,492,507 -12,862,349
android hermes armeabi-v7a 7810577 n/a
android hermes x86 8962965 n/a
android hermes x86_64 8823940 n/a
android jsc arm64-v8a 9,151,844 -15,398,147
android jsc armeabi-v7a 8341472 n/a
android jsc x86 9205131 n/a
android jsc x86_64 9463803 n/a

Base commit: fcd526d
Branch: main

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 15, 2024
Copy link
Contributor

@NickGerleman NickGerleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base of this PR is many months old. Please rebase.

When not drawing a border, the mGapBetweenPaths adjustment
can create noticable pixelation when drawing curves through a low
number of pixels.  This is noticable mostly on buttons and such
on low-dpi devices.  This fix only applies the fix if clipping
for the border radius is done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Pick Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants