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

Normalize doesn't work on android #19

Open
momolafrooo opened this issue Nov 27, 2021 · 1 comment
Open

Normalize doesn't work on android #19

momolafrooo opened this issue Nov 27, 2021 · 1 comment

Comments

@momolafrooo
Copy link

momolafrooo commented Nov 27, 2021

I'm using this package and it works perfectly on IOS but it doesn't work on android.
Can someone help me ?

@layerok
Copy link

layerok commented Oct 6, 2022

I had the same problem. I looked into the code and saw that on Android 2 pixels are being subtracted
from the end result

    if (Platform.OS === 'ios') {
        return Math.round(PixelRatio.roundToNearestPixel(newSize));
    } else {
        return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
    }
}

I removed subtraction and now normalization works fine.

But could someone explain why we are doing subtraction of 2 pixels?
UPD: I also see I am not only one asking such question #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants