korlibs-archive/korim

DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.

TobseF opened this issue · 1 comments

After Upgrading from Korge 1.10.0.0 to 1.12.2.0 my HitKlack Game doesn't run on JS target anymore.
https://github.com/TobseF/HitKlack/tree/UpgradeKorge
Platform: jsWebRun

DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.

Stacktrace

OpenglAG: Created program BatchBuilder2D.Premultiplied.Tinted with id 3 because contextVersion: -1 != 0
korio-root-korio.js:45410 DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
    at HtmlImage.renderHtmlCanvasIntoBitmap_x25gtl$ (http://127.0.0.1:9040/korim-root-korim.js:21434:20)
    at HtmlNativeImage.toNonNativeBmp (http://127.0.0.1:9040/korim-root-korim.js:21507:29)
    at HtmlNativeImage.NativeImage.toBMP32 (http://127.0.0.1:9040/korim-root-korim.js:2393:17)
    at new BitmapFont$Glyph (http://127.0.0.1:9040/korim-root-korim.js:6470:39)
    at Coroutine$readBitmapFontTxt.doResume (http://127.0.0.1:9040/korim-root-korim.js:6799:33)
    at Coroutine$loadImage_ivxn3r$.CoroutineImpl.resumeWith_tl1gpc$ (http://127.0.0.1:9040/kotlin.js:29534:35)
    at CancellableContinuationImpl.DispatchedTask.run (http://127.0.0.1:9040/kotlinx-coroutines-core.js:32877:22)
    at GameWindowCoroutineDispatcher.executePending_p8meis$ (http://127.0.0.1:9040/korgw-root-korgw.js:12387:30)
    at http://127.0.0.1:9040/korgw-root-korgw.js:15364:52
printStackTrace_0 @ korio-root-korio.js:45410
korio-root-korio.js:45411 Error: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
    at HtmlImage.renderHtmlCanvasIntoBitmap_x25gtl$ (korim-root-korim.js:21434)
    at HtmlNativeImage.toNonNativeBmp (korim-root-korim.js:21507)
    at HtmlNativeImage.NativeImage.toBMP32 (korim-root-korim.js:2393)
    at new BitmapFont$Glyph (korim-root-korim.js:6470)
    at Coroutine$readBitmapFontTxt.doResume (korim-root-korim.js:6799)
    at Coroutine$loadImage_ivxn3r$.CoroutineImpl.resumeWith_tl1gpc$ (kotlin.js:29534)
    at CancellableContinuationImpl.DispatchedTask.run (kotlinx-coroutines-core.js:32877)
    at GameWindowCoroutineDispatcher.executePending_p8meis$ (korgw-root-korgw.js:12387)
    at korgw-root-korgw.js:15364
printStackTrace_0 @ korio-root-korio.js:45411
kotlinx-coroutines-core.js:35845 DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The source width is 0.
    at HtmlImage.renderHtmlCanvasIntoBitmap_x25gtl$ (http://127.0.0.1:9040/korim-root-korim.js:21434:20)
    at HtmlNativeImage.toNonNativeBmp (http://127.0.0.1:9040/korim-root-korim.js:21507:29)
    at HtmlNativeImage.NativeImage.toBMP32 (http://127.0.0.1:9040/korim-root-korim.js:2393:17)
    at new BitmapFont$Glyph (http://127.0.0.1:9040/korim-root-korim.js:6470:39)
    at Coroutine$readBitmapFontTxt.doResume (http://127.0.0.1:9040/korim-root-korim.js:6799:33)
    at Coroutine$loadImage_ivxn3r$.CoroutineImpl.resumeWith_tl1gpc$ (http://127.0.0.1:9040/kotlin.js:29534:35)
    at CancellableContinuationImpl.DispatchedTask.run (http://127.0.0.1:9040/kotlinx-coroutines-core.js:32877:22)
    at GameWindowCoroutineDispatcher.executePending_p8meis$ (http://127.0.0.1:9040/korgw-root-korgw.js:12387:30)
    at http://127.0.0.1:9040/korgw-root-korgw.js:15364:52
handleCoroutineExceptionImpl @ kotlinx-coroutines-core.js:35845
kotlin.js:32459 OpenglAG: Created program BatchBuilder2D.NoPremultiplied.Tinted with id 13 because contextVersion: -1 != 0

Fixed