-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[web] Paragraph.getBoxesForRange uses LineMetrics #16625
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit, otherwise LGTM
return ui.TextBox.fromLTRBD( | ||
left + line.left, | ||
top, | ||
line.width + line.left - right, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add comment above explaining why -right
// |-------------|------------------|-------------|-----------------| | ||
// | ||
// ^^^^^^^^^^^^^ | ||
// This is the box we want to return. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the ASCII art docs 👍
@@ -426,6 +426,209 @@ void main() async { | |||
expect(paragraph.getBoxesForRange(0, 0), isEmpty); | |||
}); | |||
|
|||
testEachMeasurement('getBoxesForRange multi-line', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth adding a test for a ParagraphStyle
with maxLines
such that the start
/end
range fall outside the max line bounds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good corner case to test. I'd like to merge this PR while the tree is green though. So I'll add the maxLines
test in a future PR.
2020-02-20 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from YPr0t... to CZTpy... (flutter/engine#16708) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/skia 2c2db2762809..9d4e31d6cda5 (1 commits) (flutter/engine#16707) 2020-02-20 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from WZgbp... to 78ZcV... (flutter/engine#16706) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/dart e187e42593e8..81d4cc6bc99a (3 commits) (flutter/engine#16705) 2020-02-20 jmccandless@google.com Fix the newline on some keyboards (flutter/engine#16560) 2020-02-20 kustermann@google.com Enable lazy-async-stacks by-default in all modes (flutter/engine#16556) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/skia a5097354217b..2c2db2762809 (1 commits) (flutter/engine#16704) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/skia ed1ff23c2768..a5097354217b (1 commits) (flutter/engine#16703) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/dart 7469b87b042a..e187e42593e8 (11 commits) (flutter/engine#16702) 2020-02-20 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/linux-amd64 from VHyDa... to YPr0t... (flutter/engine#16701) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/skia 9baef3593c3c..ed1ff23c2768 (5 commits) (flutter/engine#16699) 2020-02-20 skia-flutter-autoroll@skia.org Roll src/third_party/skia 7dfb46e7f397..9baef3593c3c (3 commits) (flutter/engine#16696) 2020-02-19 xster@google.com fix param (flutter/engine#16694) 2020-02-19 skia-flutter-autoroll@skia.org Roll src/third_party/dart 0f141be8bd52..7469b87b042a (9 commits) (flutter/engine#16693) 2020-02-19 skia-flutter-autoroll@skia.org Roll src/third_party/skia c5ff41f2976e..7dfb46e7f397 (20 commits) (flutter/engine#16691) 2020-02-19 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from _jvYk... to WZgbp... (flutter/engine#16692) 2020-02-19 dnfield@google.com Revert "Remove usage of Dart_AllocateWithNativeFields from tonic (flutter#16588)" (flutter/engine#16684) 2020-02-19 mouad.debbar@gmail.com [web] Paragraph.getBoxesForRange uses LineMetrics (flutter/engine#16625) 2020-02-19 skia-flutter-autoroll@skia.org Roll src/third_party/dart 707ecda05e14..0f141be8bd52 (4 commits) (flutter/engine#16683)
)" This reverts commit 70767fb.
Fixes flutter/flutter#39826