Horis 1 vuosi sitten
vanhempi
commit
45e9a84c5f

+ 1 - 1
app/src/main/java/io/legado/app/utils/canvasrecorder/CanvasRecorderExtensions.kt

@@ -23,8 +23,8 @@ fun CanvasRecorder.recordIfNeeded(view: View): Boolean {
 }
 }
 
 
 inline fun CanvasRecorder.record(width: Int, height: Int, block: Canvas.() -> Unit) {
 inline fun CanvasRecorder.record(width: Int, height: Int, block: Canvas.() -> Unit) {
+    val canvas = beginRecording(width, height)
     try {
     try {
-        val canvas = beginRecording(width, height)
         canvas.withSave {
         canvas.withSave {
             block()
             block()
         }
         }