Skip to content

Commit

Permalink
libtxt: update paragraph_text for current libtxt behavior (flutter#14004
Browse files Browse the repository at this point in the history
)

* libtxt now calculates selection rectangles reflecting the heights of
differently styled text spans within a line (matching Blink)
* libtxt does not round the coordinates of selection rectangles (unlike Blink)
  • Loading branch information
jason-simmons authored Jan 10, 2018
1 parent 46629b7 commit 77872cc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/flutter/test/rendering/paragraph_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,14 @@ void main() {
// rendering widths in tests.
// TODO(#12357): Figure out why this is, and fix it (if needed) once Blink
// text rendering is replaced.
// anyOf for heights is needed because libtxt and Blink calculate selection
// rectangles differently.
// TODO: remove this when Blink is replaced.
expect(boxes[0].toRect().width, anyOf(14.0, 13.0));
expect(boxes[0].toRect().height, anyOf(13.0, 26.0));
expect(boxes[0].toRect().height, closeTo(13.0, 0.0001));
expect(boxes[1].toRect().width, anyOf(27.0, 26.0));
expect(boxes[1].toRect().height, 26.0);
expect(boxes[1].toRect().height, closeTo(26.0, 0.0001));
expect(boxes[2].toRect().width, anyOf(27.0, 26.0));
expect(boxes[2].toRect().height, 26.0);
expect(boxes[2].toRect().height, closeTo(26.0, 0.0001));
expect(boxes[3].toRect().width, anyOf(14.0, 13.0));
expect(boxes[3].toRect().height, anyOf(13.0, 26.0));
expect(boxes[3].toRect().height, closeTo(13.0, 0.0001));
});

test('toStringDeep', () {
Expand Down

0 comments on commit 77872cc

Please sign in to comment.