Skip to content

Commit

Permalink
Add Litho attributes to view traversal result
Browse files Browse the repository at this point in the history
Differential Revision: D67165424

fbshipit-source-id: c1c2d0057ba1f180bc8ce2ccbcd2e2786ab4518a
  • Loading branch information
Isaac Ravindran authored and facebook-github-bot committed Dec 13, 2024
1 parent 249159c commit 3941862
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions litho-core/src/main/java/com/facebook/litho/DebugComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ private constructor(
return Rect(x, y, x + result.width, y + result.height)
}

/** @return The alpha value of this component */
val alpha: Float
get() = result.node.nodeInfo?.alpha ?: 1.0f

/** @return True if this and given debug components share the same internal node */
fun isSameNode(other: DebugComponent): Boolean = node === other.node

Expand Down

0 comments on commit 3941862

Please sign in to comment.