Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't offset views rendered on top of snapshots #733

Merged
merged 3 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,9 @@ protected void onSnapshotReady(@Nullable Bitmap mapContent) {
} else {
Bitmap viewContent = viewCallback.getViewContent();
if (viewContent != null) {
snapshotReadyCallback.onSnapshotReady(BitmapUtils.mergeBitmap(mapContent, viewContent));
snapshotReadyCallback.onSnapshotReady(
BitmapUtils.mergeBitmaps(mapContent, viewContent)
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,31 @@ public static Bitmap createBitmapFromView(@NonNull View view) {
}

/**
* 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 mergeBitmaps(@NonNull Bitmap background, @NonNull Bitmap foreground) {
return mergeBitmap(background, foreground, 0f, 0f);
}

/**
* Create a bitmap from a background and a foreground bitmap
*
Expand Down