Skip to content

Commit

Permalink
Fix incorrect application of overlay if bitmap size differs
Browse files Browse the repository at this point in the history
  • Loading branch information
udenr committed Aug 19, 2024
1 parent e945e8b commit 73cfd8b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ class SketchActivity : BaseNoteActivity(DbContract.NoteEntry.TYPE_SKETCH), OnDia
val bmOverlay = Bitmap.createBitmap(width, height, config)
val canvas = Canvas(bmOverlay)
canvas.drawBitmap(this, Matrix(), null)
canvas.drawBitmap(bitmap, 0f, 0f, null)
if (width != bitmap.width || height != bitmap.height) {
canvas.drawBitmap(bitmap, Rect(0, 0, bitmap.width, bitmap.height), Rect(0, 0, width, height), null)
} else {
canvas.drawBitmap(bitmap, 0f, 0f, null)
}
return bmOverlay
}

Expand Down

0 comments on commit 73cfd8b

Please sign in to comment.