Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bounding box function, get rid of extensions, copied from imported libraries #56

Merged
merged 1 commit into from Sep 7, 2022

Conversation

ghost
Copy link

@ghost ghost commented Sep 6, 2022

Before:
Screenshot_1662465219
After:
Screenshot_1662465166

As you can see, there are 2 bugs in current getBoundingBoxes implementation:

  • Outer composable (column in our case) take full screen width, except of padding 20.dp, but bounding boxes are much far away from right than from left
  • There is precision loose which you can find on screenshots for "filled blue" spans, so box for "the parts" are not aligned.

If you still need this "trim box to width" functionality, than maybe we can mix implementations, but better idea would be to create feature request to TextField composable (more precisely to TextLayoutResult) to return trimmed bounding boxes (for example with next function TextLayoutResult.getPathForRange(start, end, trim: Boolean)

@ghost ghost requested a review from Akucuki September 6, 2022 12:12
@Akucuki Akucuki requested a review from Skyyo September 6, 2022 15:08
@Skyyo Skyyo merged commit 22e38b8 into master Sep 7, 2022
@Skyyo Skyyo deleted the fix_span_related_extensions branch September 7, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants