-
-
Save vinaygaba/c0c369d973c2743f1914ccfacdba96ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Modifier.boundingBox( | |
color: Color = Color.Red, | |
strokeWidth: Float = 5f, | |
) = drawWithCache { | |
val stroke = Stroke(strokeWidth) | |
val size = Size(size.width, size.height) | |
onDrawWithContent { | |
drawContent() | |
drawRect( | |
color = color, | |
size = size, | |
style = stroke | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment