Skip to content

Commit 3712464

Browse files
author
therealbluepandabear
committed
Move drawTransparent out of onDraw and instead into onSizeChanged.
1 parent 027c2f4 commit 3712464

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/therealbluepandabear/pixapencil/customviews/transparentbackgroundview/TransparentBackgroundView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ class TransparentBackgroundView(context: Context, attributeSet: AttributeSet): V
5959

6060
transparentBackgroundViewBitmap = Bitmap.createBitmap(bitmapWidth, bitmapHeight, Bitmap.Config.ARGB_8888)
6161
transparentBackgroundViewCanvas = Canvas(transparentBackgroundViewBitmap)
62+
63+
transparentBackgroundViewBitmap.drawTransparent()
6264
}
6365

6466
override fun onDraw(canvas: Canvas) {
6567
if (::transparentBackgroundViewBitmap.isInitialized) {
6668
val (matrix, _, _) = transparentBackgroundViewBitmap.calculateMatrix(viewWidth.toFloat(), viewHeight.toFloat())
6769
canvas.drawBitmap(transparentBackgroundViewBitmap, matrix, PaintCompat.getSDK28PaintOrNull())
68-
69-
transparentBackgroundViewBitmap.drawTransparent()
7070
}
7171
}
7272
}

0 commit comments

Comments
 (0)