Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d46a52e

Browse files
committed
address comments
1 parent 62275a0 commit d46a52e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

lib/web_ui/lib/src/engine/text/canvas_paragraph.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class CanvasParagraph implements EngineParagraph {
3030
/// The number of placeholders in this paragraph.
3131
final int placeholderCount;
3232

33+
// Defaulting to -1 for non-laid-out paragraphs like the native engine does.
3334
@override
3435
double width = -1.0;
3536

lib/web_ui/lib/src/engine/text/paragraph.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ class DomParagraph implements EngineParagraph {
245245

246246
bool get _hasLineMetrics => _measurementResult?.lines != null;
247247

248+
// Defaulting to -1 for non-laid-out paragraphs like the native engine does.
248249
@override
249250
double get width => _measurementResult?.width ?? -1;
250251

lib/web_ui/test/text/canvas_paragraph_builder_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ void testMain() {
1717
WebExperiments.ensureInitialized();
1818
});
1919

20+
// TODO(mdebbar): Add checks for the output of `toDomElement()` in all the
21+
// tests below.
22+
2023
test('Builds a text-only canvas paragraph', () {
2124
final EngineParagraphStyle style = EngineParagraphStyle(fontSize: 13.0);
2225
final CanvasParagraphBuilder builder = CanvasParagraphBuilder(style);

0 commit comments

Comments
 (0)