commit | c8462ae688980e2af4a809a28c1b8bdec42d7827 | [log] [tgz] |
---|---|---|
author | Albert Chang <mxalbert1996@gmail.com> | Thu Apr 04 21:46:31 2024 +0900 |
committer | Albert Chang <mxalbert1996@gmail.com> | Thu Apr 04 21:56:16 2024 +0900 |
tree | cb1a3d7ea2fcbd2f5386e515feee662c1b81a1fb | |
parent | 8d8696baf2233469d80b5925535981d5b6e00e16 [diff] [blame] |
Fix content rect calculation in SelectionManager Fix a typo in `SelectionManager.getContentRect()` that results in an invalid rect being calculated, causing text toolbar to not show under certain conditions. Fixes: b/332782845 Test: manual Change-Id: I153b99f4146d870182af2898d9a675ed6ffa15e4
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.kt index e18450f..c01b952 100644 --- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.kt +++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.kt
@@ -553,7 +553,7 @@ if (visibleRect.width < 0 || visibleRect.height < 0) return null val rootRect = visibleRect.translate(containerCoordinates.positionInRoot()) - return rootRect.copy(bottom = visibleRect.bottom + HandleHeight.value * 4) + return rootRect.copy(bottom = rootRect.bottom + HandleHeight.value * 4) } // This is for PressGestureDetector to cancel the selection.