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

kquan opened this Issue Feb 17, 2014 · 2 comments


None yet
2 participants

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

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 commented Feb 17, 2014

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


mg6maciej commented Feb 17, 2014

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 in a9f4509 Feb 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment