Skip to content

Commit 7ce4746

Browse files
authored
[web] Accept the capped letter spacing line shift in kitchensink (flutter#196148)
The SkParagraph kitchensink test in canvaskit_api_test.dart pins LineMetrics.left to 2.5. Its line starts with letterSpacing 5 and ends with an unspaced "!", and Skia shifted the whole line right by half the first spacing, so the "!" ended 2.5 px past the line width. A Skia change for flutter#184815 caps the shift by the half spacing of the visually last cluster, which is 0 here, and it broke the Skia roll (flutter#196144). Accept both 2.5 and 0 so the Skia change can reland. A follow-up after the roll expects 0 only. Assisted-by: Claude Opus 5.5 (Medium)
1 parent 9ac9b06 commit 7ce4746

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎engine/src/flutter/lib/web_ui/test/canvaskit/canvaskit_api_test.dart‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,13 @@ void _paragraphTests() {
16321632
expect(lineMetrics.isHardBreak, isTrue);
16331633
expectAlmost(lineMetrics.baseline, 78.6);
16341634
expectAlmost(lineMetrics.height, 108);
1635-
expectAlmost(lineMetrics.left, 2.5);
1635+
// The line starts with letterSpacing 5 and ends with an unspaced "!", so capping the line
1636+
// shift by the half spacing of the visually last cluster reduces left from 2.5 to 0.
1637+
// TODO(Rusino): Expect only 0 once https://github.com/flutter/flutter/issues/184815 rolls in.
1638+
expect(
1639+
lineMetrics.left,
1640+
anyOf(within<double>(distance: 0.025, from: 2.5), within<double>(distance: 0.025, from: 0)),
1641+
);
16361642
expectAlmost(lineMetrics.width, 263);
16371643
expect(lineMetrics.lineNumber, 0);
16381644

0 commit comments

Comments
 (0)