Skip to content

Commit

Permalink
Revert default block invocation change
Browse files Browse the repository at this point in the history
  • Loading branch information
zsoltk committed Sep 5, 2023
1 parent 1c1c060 commit 576fbe3
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,19 @@ fun <InteractionTarget : Any, ModelState : Any> ParentNode<InteractionTarget>.Ap
clipToBounds: Boolean = false,
gestureValidator: GestureValidator = GestureValidator.defaultValidator,
gestureExtraTouchArea: Dp = defaultExtraTouch,
block: @Composable ChildrenTransitionScope<InteractionTarget, ModelState>.() -> Unit = {
children { child, elementUiModel ->
child(elementUiModel.modifier)
}
}
block: @Composable (ChildrenTransitionScope<InteractionTarget, ModelState>.() -> Unit)? = null,
) {
val density = LocalDensity.current
val screenWidthPx = (LocalScreenSize.current.widthDp * density.density).value.roundToInt()
val screenHeightPx = (LocalScreenSize.current.heightDp * density.density).value.roundToInt()
val coroutineScope = rememberCoroutineScope()
var containerSize by remember { mutableStateOf(IntSize.Zero) }
var uiContext by remember { mutableStateOf<UiContext?>(null) }
val childrenBlock = block ?: {
children { child, _ ->
child()
}
}

LaunchedEffect(uiContext) {
uiContext?.let { appyxComponent.updateContext(it) }
Expand Down Expand Up @@ -99,8 +100,8 @@ fun <InteractionTarget : Any, ModelState : Any> ParentNode<InteractionTarget>.Ap
}
}
) {
CompositionLocalProvider(LocalBoxScope provides this) {
block(
CompositionLocalProvider(LocalBoxScope provides this@Box) {
childrenBlock(
ChildrenTransitionScope(containerSize, appyxComponent, gestureExtraTouchArea, gestureValidator)
)
}
Expand Down Expand Up @@ -141,7 +142,7 @@ class ChildrenTransitionScope<InteractionTarget : Any, NavState : Any>(
.forEach { elementUiModel ->
val id = elementUiModel.element.id

key(elementUiModel.element.id) {
key(id) {
var transformedBoundingBox by remember(id) { mutableStateOf(Rect.Zero) }
var elementSize by remember(id) { mutableStateOf(IntSize.Zero) }
var offsetCenter by remember(id) { mutableStateOf(Offset.Zero) }
Expand Down

0 comments on commit 576fbe3

Please sign in to comment.