Skip to content

Commit 4bcc736

Browse files
Partially revert previous change to ImageLayer.getBounds() (#2623)
The changes in #2578 set the bounds returned by `ImageLayer.getBounds()` to have 0 width and 0 height if there is no Bitmap available. This change instead calls the previous version of the logic which reads the width and height of the `LottieImageAsset`.
1 parent b51e346 commit 4bcc736

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lottie/src/main/java/com/airbnb/lottie/model/layer/ImageLayer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public class ImageLayer extends BaseLayer {
111111
if (bitmap != null) {
112112
outBounds.set(0, 0, bitmap.getWidth() * scale, bitmap.getHeight() * scale);
113113
} else {
114-
// If the bitmap is null, we aren't rendering anything, so set outBounds to an empty rectangle
115-
outBounds.set(0, 0, 0, 0);
114+
// If the bitmap is null, fall back to using the width and height of the LottieImageAsset
115+
outBounds.set(0, 0, lottieImageAsset.getWidth() * scale, lottieImageAsset.getHeight() * scale);
116116
}
117117
}
118118
boundsMatrix.mapRect(outBounds);

0 commit comments

Comments
 (0)