mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
ViewCopiesKt: IllegalArgumentException: width and height must be > 0 fix
commit_hash:ef17ab153dbd6906ceed6906470317a6c3edd429
This commit is contained in:
@@ -62,12 +62,15 @@ private fun ImageView.setScreenshotFromView(view: View) {
|
||||
}
|
||||
|
||||
val drawAndSet = {
|
||||
val bitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888).applyCanvas {
|
||||
translate(-view.scrollX.toFloat(), -view.scrollY.toFloat())
|
||||
view.draw(this)
|
||||
}
|
||||
if (view.width > 0 && view.height > 0) {
|
||||
val bitmap =
|
||||
Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888).applyCanvas {
|
||||
translate(-view.scrollX.toFloat(), -view.scrollY.toFloat())
|
||||
view.draw(this)
|
||||
}
|
||||
|
||||
setImageBitmap(bitmap)
|
||||
setImageBitmap(bitmap)
|
||||
}
|
||||
}
|
||||
|
||||
if (view.isActuallyLaidOut) {
|
||||
|
||||
Reference in New Issue
Block a user