Don't offset views rendered on top of snapshots (#733)
This commit is contained in:
@@ -1161,7 +1161,9 @@ final class NativeMapView implements NativeMap {
|
||||
} else {
|
||||
Bitmap viewContent = viewCallback.getViewContent();
|
||||
if (viewContent != null) {
|
||||
snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent));
|
||||
snapshotReadyCallback.onSnapshotReady(
|
||||
BitmapUtils.mergeBitmaps(mapContent, viewContent)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,14 +47,29 @@ public class BitmapUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a bitmap from a background and a foreground bitmap
|
||||
* Create a bitmap from a background and a foreground bitmap. The foreground bitmap
|
||||
* will be shifted 10px to the right and 10px to the bottom relative to the background.
|
||||
*
|
||||
* @param background The bitmap placed in the background
|
||||
* @param foreground The bitmap placed in the foreground
|
||||
* @return the merged bitmap
|
||||
* @deprecated {@link #mergeBitmaps(Bitmap, Bitmap)} should be used instead, as it does not
|
||||
* shift the input by 10px to the right and bottom.
|
||||
*/
|
||||
@Deprecated
|
||||
public static Bitmap mergeBitmap(@NonNull Bitmap background, @NonNull Bitmap foreground) {
|
||||
return mergeBitmap(background, foreground, 10f, 10f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a bitmap from a background and a foreground bitmap.
|
||||
*
|
||||
* @param background The bitmap placed in the background
|
||||
* @param foreground The bitmap placed in the foreground
|
||||
* @return the merged bitmap
|
||||
*/
|
||||
public static Bitmap mergeBitmap(@NonNull Bitmap background, @NonNull Bitmap foreground) {
|
||||
return mergeBitmap(background, foreground, 10f, 10f);
|
||||
public static Bitmap mergeBitmaps(@NonNull Bitmap background, @NonNull Bitmap foreground) {
|
||||
return mergeBitmap(background, foreground, 0f, 0f);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user