Skip to content

Commit

Permalink
[SuperTextField] Fix golden failure (Resolves #2343) (#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosilvestre authored Oct 19, 2024
1 parent 0363760 commit 8615dff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions super_editor/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ dependencies:
flutter_test_robots: ^0.0.24
clock: ^1.1.1

#dependency_overrides:
dependency_overrides:
# Override to local mono-repo path so devs can test this repo
# against changes that they're making to other mono-repo packages
# attributed_text:
# path: ../attributed_text
# super_text_layout:
# path: ../super_text_layout
# attributed_text:
# path: ../attributed_text
super_text_layout:
path: ../super_text_layout

dev_dependencies:
flutter_lints: ^2.0.1
Expand Down
8 changes: 7 additions & 1 deletion super_text_layout/lib/src/super_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,13 @@ class RenderLayoutAwareParagraph extends RenderParagraph {
..textDirection = textDirection
..textAlign = textAlign
..layout();
size = Size(size.width, _textPainter.height);

// We have no text, so we set the height of this render object to the line height
// of an arbitrary character of the given style. However, it's possible that our
// parent render object imposed constraints that are shorter than a single line
// of text. To avoid breaking Flutter's layout rules, we take the minimum height
// between the single line of text, and the incoming height constraints.
size = constraints.constrain(Size(size.width, _textPainter.height));
}
}
}
Expand Down

0 comments on commit 8615dff

Please sign in to comment.