move Compose submodule and update mpp demo (#1678)

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
This commit is contained in:
Oleksandr Karpovich
2022-01-10 15:53:03 +01:00
committed by GitHub
parent edd59c08f1
commit a7ea7b7767
5 changed files with 6 additions and 21 deletions

View File

@@ -66,12 +66,8 @@ fun FallingBalls(game: Game) {
.fillMaxHeight(1f)
.onSizeChanged {
with(density) {
if (org.jetbrains.skiko.kotlinBackend == KotlinBackend.JVM) {
// Really ugly hack, until we properly pass geometry.
// TODO: fix me in Compose.
game.width = it.width.toDp()
game.height = it.height.toDp()
}
game.width = it.width.toDp()
game.height = it.height.toDp()
}
}
) {

View File

@@ -15,11 +15,7 @@ object JsTime : Time {
fun main() {
onWasmReady {
Window("Falling Balls") {
val game = remember { Game(JsTime).apply {
// Ugly hack, properly pass geometry.
width = 800.dp
height = 800.dp
}}
val game = remember { Game(JsTime) }
FallingBalls(game)
}
}

View File

@@ -16,11 +16,7 @@ object MacosTime : Time {
fun main() {
NSApplication.sharedApplication()
Window("Falling Balls") {
val game = remember { Game(MacosTime).apply {
// TODO: rework, now we do not properly propagate geometry changes.
width = 800.dp
height = 600.dp
} }
val game = remember { Game(MacosTime) }
FallingBalls(game)
}
NSApp?.run()

View File

@@ -45,10 +45,7 @@ class SkikoAppDelegate : UIResponder, UIApplicationDelegateProtocol {
override fun application(application: UIApplication, didFinishLaunchingWithOptions: Map<Any?, *>?): Boolean {
window = UIWindow(frame = UIScreen.mainScreen.bounds)
window!!.rootViewController = Application("Falling Balls") {
val game = remember { Game(UikitTime).apply {
width = 800.dp
height = 800.dp
} }
val game = remember { Game(UikitTime) }
Column {
// To skip upper part of screen.
Box(modifier = Modifier