Hotfix for ImageConfig: we had missed the growth ratio for MatchParent case
This commit is contained in:
parent
d38532d5d4
commit
4b01d37f30
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user