Skip to content

Commit

Permalink
Merge branch 'master' into androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
goweii committed Dec 8, 2019
2 parents efdce89 + 92e0709 commit 34234e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions anylayer/src/main/java/per/goweii/anylayer/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ static Bitmap snapshot(FrameLayout decor,
int oH = (int) (h / scale);
Bitmap bitmap = Bitmap.createBitmap(oW, oH, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);

canvas.save();
int[] locationRootView = new int[2];
decor.getLocationOnScreen(locationRootView);
Expand All @@ -100,8 +99,9 @@ static Bitmap snapshot(FrameLayout decor,
int y = locationBackground[1] - locationRootView[1];
canvas.scale(1 / scale, 1 / scale);
canvas.translate(x / scale, y / scale);

decor.getBackground().draw(canvas);
if (decor.getBackground() != null) {
decor.getBackground().draw(canvas);
}
out:
for (int i = 0; i < decor.getChildCount(); i++) {
View decorChildAt = decor.getChildAt(i);
Expand Down

0 comments on commit 34234e1

Please sign in to comment.