Skip to content

Commit dc3d05b

Browse files
test version updates
deprecate debug mode
1 parent 8ac374b commit dc3d05b

6 files changed

Lines changed: 44 additions & 33 deletions

File tree

docs/debugging.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ compileSdk = "36"
44
targetSdk = "36"
55
minSdk = "23"
66

7-
packageVersion = "1.0.0"
7+
packageVersion = "1.0.1"
88

99
kotlin = "2.3.0"
1010
compose-multiplatform = "1.10.0"

mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ nav:
1717
- Bodies: bodies.md
1818
- Shapes: shapes.md
1919
- Events: events.md
20-
- Debugging: debugging.md
2120
- Performance: performance.md
2221
- Recipes:
2322
- Dragging bodies: recipes/dragging.md

physicsbox/src/commonMain/kotlin/dev/zinchenko/physicsbox/PhysicsDebugConfig.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import androidx.compose.runtime.Immutable
1515
* @property drawBounds Draw world/container boundaries used for collisions.
1616
* @property drawContacts Draw contact points/normals (if the backend exposes them).
1717
*/
18+
@Deprecated(
19+
message = "PhysicsBox debug is not implemented yet",
20+
level = DeprecationLevel.WARNING
21+
)
1822
@Immutable
1923
data class PhysicsDebugConfig(
2024
val enabled: Boolean = false,

physicsbox/src/commonMain/kotlin/dev/zinchenko/physicsbox/layout/PhysicsBox.kt

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,49 @@ import dev.zinchenko.physicsbox.units
5959
* @param state Holder of simulation state, step configuration and a command queue.
6060
* @param config World configuration (scale, boundaries, stepping, etc.). The effective step config is
6161
* merged with `state.stepConfig`.
62-
* @param debug Debug configuration (e.g., overlay, diagnostics), consumed by internal layout.
6362
* @param content Children content placed inside the physics container; use [PhysicsBoxScope.physicsBody]
6463
* to register elements in the physics world.
6564
*/
6665
@Composable
6766
fun PhysicsBox(
67+
modifier: Modifier = Modifier,
68+
state: PhysicsBoxState = rememberPhysicsBoxState(),
69+
config: PhysicsBoxConfig = PhysicsBoxConfig(),
70+
content: @Composable PhysicsBoxScope.() -> Unit,
71+
) {
72+
PhysicsBoxImpl(
73+
modifier = modifier,
74+
state = state,
75+
config = config,
76+
debug = PhysicsDebugConfig(),
77+
content = content,
78+
)
79+
}
80+
81+
@Deprecated(
82+
message = "PhysicsBox debug is not implemented yet. Parameter is reserved and currently ignored. Do not pass it.",
83+
level = DeprecationLevel.WARNING,
84+
replaceWith = ReplaceWith("PhysicsBox(modifier = modifier, state = state, config = config, content = content)")
85+
)
86+
@Composable
87+
fun PhysicsBox(
88+
modifier: Modifier = Modifier,
89+
state: PhysicsBoxState = rememberPhysicsBoxState(),
90+
config: PhysicsBoxConfig = PhysicsBoxConfig(),
91+
debug: PhysicsDebugConfig = PhysicsDebugConfig(),
92+
content: @Composable PhysicsBoxScope.() -> Unit,
93+
) {
94+
PhysicsBoxImpl(
95+
modifier = modifier,
96+
state = state,
97+
config = config,
98+
debug = debug,
99+
content = content,
100+
)
101+
}
102+
103+
@Composable
104+
fun PhysicsBoxImpl(
68105
modifier: Modifier = Modifier,
69106
state: PhysicsBoxState = rememberPhysicsBoxState(),
70107
config: PhysicsBoxConfig = PhysicsBoxConfig(),

sharedUI/src/commonMain/kotlin/com/zinchenkodev/app/demos/BasicStackingDemoScreen.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ fun BasicStackingDemoScreen(
149149
is PhysicsShape.Polygon -> polygonComposeShape(s)
150150
}
151151

152-
// Для круга делаем UI-квадрат, чтобы CircleShape выглядел корректно
153152
val w = item.widthDp
154153
val h = item.heightDp
155154
val circleSize = if (w < h) w else h
@@ -174,7 +173,7 @@ fun BasicStackingDemoScreen(
174173
rotationDegrees = item.rotationDegrees,
175174
),
176175
),
177-
shape = item.physicsShape, // <-- главное изменение
176+
shape = item.physicsShape,
178177
isDraggable = true,
179178
dragConfig = DragConfig(
180179
maxForce = 1_600f,

0 commit comments

Comments
 (0)