Fixed
Status Update
Comments
js...@google.com <js...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #2
from the dupped ticket
this is related to upstream/downstream.
i agree that it should return the correct right value. (similar to the code in here:
Not 100% if upstream/downstream applies to character boundaries, therefore if we should accept a parameter upstream which is true by default.
si...@google.com <si...@google.com> #3
note: i dont think that function works correctly with Bidi.
- needs tests.
- possibly should check secondaryhorizontal in BiDi case (again as in the TextLayout code above)
- changing getBoundingBox might have side effects on selection/magnifier, should be checked
si...@google.com <si...@google.com> #4
ha...@google.com <ha...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit e498138fb6046f025446840c4c42301eb672fc6a
Author: Halil Ozercan <halilibo@google.com>
Date: Mon Jul 25 11:51:20 2022
Add RTL and BiDi support to getBoundingBox in Paragraph
This change adopts the logic from fillBoundingBoxes function in AndroidParagraph to getBoundingBox for single character queries. Even when fillBoundingBoxes gets added to Paragraph interface, getBoundingBox was returning faulty values for end of the line whitespaces as reported in b/197146630
Fix: b/197146630
Test: ParagraphIntegrationTest.kt
Test: :compose:ui:ui-text:cAT
Change-Id: Id5ba884fa5700f6a473dd01fe663c2bde27b62b4
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
M text/text/src/main/java/androidx/compose/ui/text/android/TextLayout.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
https://android-review.googlesource.com/2159102
Branch: androidx-main
commit e498138fb6046f025446840c4c42301eb672fc6a
Author: Halil Ozercan <halilibo@google.com>
Date: Mon Jul 25 11:51:20 2022
Add RTL and BiDi support to getBoundingBox in Paragraph
This change adopts the logic from fillBoundingBoxes function in AndroidParagraph to getBoundingBox for single character queries. Even when fillBoundingBoxes gets added to Paragraph interface, getBoundingBox was returning faulty values for end of the line whitespaces as reported in
Fix:
Test: ParagraphIntegrationTest.kt
Test: :compose:ui:ui-text:cAT
Change-Id: Id5ba884fa5700f6a473dd01fe663c2bde27b62b4
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
M text/text/src/main/java/androidx/compose/ui/text/android/TextLayout.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
Description
Jetpack Compose release version: 1.1.0-alpha02
Android Studio Build: Android Studio Bumblebee | 2021.1.1 Canary 8 Build #AI-211.7628.21.2111.7619903, built on August 7, 2021
I need to get rects of part of the
Text
substingLooking through
TextLayoutResult
I've foundgetPathForRange
, it returnsPath
which is exactly what I need except I can't modify returned path. Perfectly I'd like to have a method to get list ofRect
s.So I found
getBoundingBox
which returns needed rect only for a single character. And there I've faced a bug:right
value of each last space in a text line is zero:Console output:
Note here characters 5, 11, 21