JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.15k stars 1.17k forks source link

[Web, Canvas] Crash in Skiko with RoundedCornerShape #2514

Closed DSteve595 closed 1 year ago

DSteve595 commented 1 year ago

Drawing a Surface with certain RoundedCornerShapes crashes Skia. It doesn't crash with RectangleShape or RoundedCornerShape(16.dp), only seems to crash when setting radii per corner, e.g. RounderCornerShape(topStart = 8.dp, topEnd = 8.dp). From the browser console:

skiko.wasm:0x266c94 Uncaught RuntimeError: remainder by zero
    at skiko.wasm:0x266c94
    at skiko.wasm:0x2674ce
    at skiko.wasm:0x272f76
    at skiko.wasm:0x2d65f2
    at skiko.wasm:0x34aa97
    at skiko.wasm:0x2c3c7e
    at skiko.wasm:0x2c6aa3
    at skiko.wasm:0x279300
    at skiko.wasm:0x269ade
    at skiko.wasm:0x269522

Sample project Run ./gradlew jsBrowserDist && ./gradlew jsBrowserRun, click the bottom option to repro the crash

dima-avdeev-jb commented 1 year ago

Add reproducer to GitHub: https://github.com/dima-avdeev-jb/reproduce-js-canvas-rounded-corner-shape

alexzhirkevich commented 1 year ago

This was fixed in https://github.com/JetBrains/compose-multiplatform-core/pull/550 and fix is available in 1.4.1

dima-avdeev-jb commented 1 year ago

Fixed in 1.4.1

okushnikov commented 3 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.