-
Notifications
You must be signed in to change notification settings - Fork 55
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
discrepancy between debug and release rendering #12
Comments
I have also noticed this! Any insights since your post, @mcconkiee? |
Hi. We're also seeing this. I think it is related to: issue on stackoverflow
|
@hblumberg can you open a PR with your changes please? |
I've been trying to read about the difference in bitmap density vs. device density, re @hblumberg's change. It seems to me that ordinarily, they'd match, but if the app didn't provide all the appropriate |
I'd be happy to open a PR with my change, @EyMaddis, but unfortunately it doesn't fix the debug vs. release discrepancy. 1.5x devices (for example) still look distorted on debug builds, but correct on release builds. I didn't make a PR because of @tcherna's point. I do think it's worth rounding later (after multiplying by the insets), but I'm not sure if folks rely on the existing density calculation. |
@hblumberg, Had you tried your code with the later rounding but using the bitmap density calculation to see how it performed with debug/release? |
I did some logging and testing and I actually don't see any difference in the values from getDisplayMetrics().density vs bitmap.getDensity()/160.0f. On the device where I do see a rendering error in debug, the issue is that the bitmap returned is the wrong size compared with release (it looks like its a 2x image vs the scaled image), which doesn't make sense since the factory is always supposed to return an image scaled to the target density (by default). |
madsleejensen#12 reference - Summary: The previous calculation rounded the `ratio` / `density` immediately, which affected calculations. (1.5x devices were treated as 2x.) I don't quite understand why the calculation used the bitmap density instead of the device density, but I think this is a more reliable calculation (since it doesn't depend what assets are used). Test Plan: - (See RN side changes to the popover background.) Reviewers: jared, nrowe Reviewed By: jared Subscribers: #mobile Differential Revision: https://phabricator.khanacademy.org/D43038
We found this an issue too, our solution was to remove the ratio calculation and so the configured nine patch rect area always operates on actual image pixels. |
@DevopsElectricJukebox this is working at production env? thanks |
Hi - I have an effect to which I am unclear the issue. When building in debug the module works as expected:
however in release build, it looks like this:
the relative code :
I am unclear how to resolve this issue. Any help is appreciated!
The text was updated successfully, but these errors were encountered: