From a9b16ad7c51a2b32f7dc3722ad2d6774f3050493 Mon Sep 17 00:00:00 2001 From: EternalChildren Date: Thu, 13 Jun 2019 15:30:29 +0800 Subject: [PATCH] fix the bug that deposit the wrong bitmap to buffer --- .../src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java b/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java index 975b713a..680a48b5 100644 --- a/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java +++ b/android/src/main/java/fr/greweb/reactnativeviewshot/ViewShot.java @@ -478,7 +478,7 @@ private static void recycleBitmap(@NonNull final Bitmap bitmap) { private static Bitmap getBitmapForScreenshot(final int width, final int height) { synchronized (guardBitmaps) { for (final Bitmap bmp : weakBitmaps) { - if (bmp.getWidth() >= width && bmp.getHeight() >= height) { + if (bmp.getWidth() == width && bmp.getHeight() == height) { weakBitmaps.remove(bmp); bmp.eraseColor(Color.TRANSPARENT); return bmp;