Skip to content

Commit

Permalink
More info
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudje committed Feb 28, 2024
1 parent 0e5ba27 commit d003f17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/commonMain/kotlin/com/ewoudje/eggui/EGGPass.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.ewoudje.eggui

import com.ewoudje.eggui.components.EGGChildComponent

interface EGGPass {
fun shouldStop(pos: Pos): Boolean = false
fun shouldStop(pos: Pos, size: CalculatedSize, component: EGGChildComponent): Boolean = false
}
interface EGGInitPass: EGGPass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private fun traverse(comp: EGGComponent, ctx: EGGContext, trace: Trace) {

trace.enter(comp)
comp.children.forEach {
if (ctx.pass.shouldStop(newCtx.getPosition(it.childId))) return@forEach
if (ctx.pass.shouldStop(newCtx.getPosition(it.childId), newCtx.getSize(it.childId), it)) return@forEach

traverse(it, newCtx, trace)
}
Expand Down

0 comments on commit d003f17

Please sign in to comment.