Hotfix for ImageConfig: we had missed the growth ratio for MatchParent case

This commit is contained in:
Daniel Leal 2018-01-29 12:35:11 +01:00
parent d38532d5d4
commit 4b01d37f30

View File

@ -189,10 +189,10 @@ public class AsyncDrawable extends Drawable {
final ImageWidth imageWidth = imageConfig.getImageWidth(); final ImageWidth imageWidth = imageConfig.getImageWidth();
if (imageWidth == ImageWidth.MatchParent) { if (imageWidth == ImageWidth.MatchParent) {
final float aspectRatio = (float) bounds.width() / bounds.height(); final float growthRatio = (float) canvasWidth / bounds.width();
bounds.left = 0; bounds.left = 0;
bounds.right = canvasWidth; bounds.right = canvasWidth;
bounds.bottom = (int) (bounds.top + bounds.height() * aspectRatio); bounds.bottom = (int) (bounds.top + bounds.height() * growthRatio);
} else { } else {
switch (gravity) { switch (gravity) {
case Left: case Left: