Skip to content

Commit eb751c9

Browse files
committed
Add a way to get all compose views
1 parent d63591e commit eb751c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

media-placeholders/src/main/java/org/wordpress/aztec/placeholders/ComposePlaceholderManager.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,10 @@ class ComposePlaceholderManager(
616616
}
617617
return source
618618
}
619+
620+
fun getViewInPosition(x: Float, y: Float): ComposeView? {
621+
return composeViewState.value.values.firstOrNull {
622+
(it.topMargin < y && (it.topMargin + it.height) > y) && (it.leftMargin < x && (it.leftMargin + it.width) > x)
623+
}
624+
}
619625
}

0 commit comments

Comments
 (0)