File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
workflow-trace-viewer/src/jvmMain/kotlin/com/squareup/workflow1/traceviewer Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.squareup.workflow1.traceviewer
2
2
3
3
import androidx.compose.foundation.gestures.awaitEachGesture
4
4
import androidx.compose.foundation.layout.Box
5
+ import androidx.compose.foundation.layout.fillMaxSize
5
6
import androidx.compose.foundation.layout.wrapContentSize
6
7
import androidx.compose.runtime.Composable
7
8
import androidx.compose.runtime.getValue
@@ -29,12 +30,9 @@ public fun SandboxBackground(
29
30
var scale by remember { mutableStateOf(1f ) }
30
31
var offset by remember { mutableStateOf(Offset .Zero ) }
31
32
32
- Box (
33
+ Box (
33
34
modifier = Modifier
34
- .wrapContentSize(
35
- unbounded = true ,
36
- align = Alignment .TopStart
37
- ) // this allows the content to be larger than the initial screen of the app
35
+ .fillMaxSize()
38
36
.pointerInput(Unit ) { // this allows for user's panning to view different parts of content
39
37
awaitEachGesture {
40
38
val event = awaitPointerEvent()
@@ -64,13 +62,18 @@ public fun SandboxBackground(
64
62
}
65
63
}
66
64
}
67
- .graphicsLayer {
68
- translationX = offset.x
69
- translationY = offset.y
70
- scaleX = scale
71
- scaleY = scale
72
- }
73
- ) {
74
- content()
65
+ ){
66
+ Box (
67
+ modifier = Modifier
68
+ .wrapContentSize(unbounded = true , align = Alignment .Center )
69
+ .graphicsLayer {
70
+ translationX = offset.x
71
+ translationY = offset.y
72
+ scaleX = scale
73
+ scaleY = scale
74
+ }
75
+ ) {
76
+ content()
77
+ }
75
78
}
76
79
}
You can’t perform that action at this time.
0 commit comments