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

9-patch graphics for bubble do not scale correctly on XXHDPI devices #59

Closed
kquan opened this issue Feb 17, 2014 · 2 comments
Closed

9-patch graphics for bubble do not scale correctly on XXHDPI devices #59

kquan opened this issue Feb 17, 2014 · 2 comments

Comments

@kquan
Copy link

kquan commented Feb 17, 2014

When using the IconGenerator to create a marker, the marker looks correct on XHDPI devices. However, on a XXHDPI device such as the Nexus 5, the 9-patch does not seem to be stretched correctly.

Here is an example
marker

In this example, the anchor of the marker should be on the black dot in the red circle. Secondly, the anchor of the bubble is not rendered in the middle of the bubble.

I've fixed this issue locally by copying the bubbles I need into the drawable-nodpi folder instead of drawable-hdpi. However, I think the same or similar fix should be performed at the library level.

@kquan
Copy link
Author

kquan commented Feb 17, 2014

If it helps, I can submit a pull request with my suggested fix for this.

@mg6maciej
Copy link
Contributor

The cause of this issue is that image scaled from xhdpi to xxhdpi is resized 1.5 times and it may happen one of the stretched pixel columns is replicated and the other is not.
While your solution is ok, it will cause all parts of the image (paddings, upside-down caret, rounded corners) appear bigger on devices with lower densities and smaller on extra, extra (extra and in the future probably one more extra ;)) high density screens. Over 5 times bigger on ldpi compared to xxxhdpi.
A more appropriate way would be to duplicate stretched region's pixels 8 times for xhdpi, so when it is scaled to xxhdpi, it will always be 12 pixels on both regions and when scaled down to ldpi - 3 pixels.
Just a suggestion.

@broady broady closed this as completed in a9f4509 Feb 17, 2014
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