ProCraft for Android: An Android native painting app written in Rust
Rust
fix(canvas): keep the canvas in place when the display turned while the app was away
Josh63ca475ac357
diff --git a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasSurfaceView.kt b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasSurfaceView.ktindex 9fe2ef7..024a98f 100644--- a/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasSurfaceView.kt+++ b/apps/procraft-android/android/app/src/main/java/io/github/artcraftandroid/procraft/canvas/CanvasSurfaceView.kt@@ -305,6 +305,9 @@ class CanvasSurfaceView(context: Context, private val vm: CanvasViewModel) : Surtry {s.attachWindow(id.toULong(), width.toUInt(), height.toUInt())s.setDisplayScale(resources.displayMetrics.density)+ // the display turned while there was no window (the app away, the upright lock screen):+ // the view follows now, as it would have then, so the canvas stays put on the glass+ if (session === s && windowWidth > 0 && rotation != windowRotation) followTurn(s, windowRotation, rotation)session = sattached = truevm.refreshView()