Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

zero-sized RenderConstraintsTransformBox respects clipBehavior#147349

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletionspackages/flutter/lib/src/rendering/shifted_box.dart
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -896,9 +896,7 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO

@override
void paint(PaintingContext context, Offset offset) {
// There's no point in drawing the child if we're empty, or there is no
// child.
if (child == null || size.isEmpty) {
if (child == null) {
return;
}

Expand All@@ -919,6 +917,9 @@ class RenderConstraintsTransformBox extends RenderAligningShiftedBox with DebugO

// Display the overflow indicator if clipBehavior is Clip.none.
assert(() {
if (size.isEmpty) {
return true;
}
switch (clipBehavior) {
case Clip.none:
paintOverflowIndicator(context, offset, _overflowContainerRect, _overflowChildRect);
Expand Down
17 changes: 17 additions & 0 deletionspackages/flutter/test/rendering/box_test.dart
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -503,6 +503,23 @@ void main() {
// At least 2 lines.
expect(constrainedHeight, greaterThanOrEqualTo(2 * unconstrainedHeight));
});

test('paints even when its size is empty', () {
// Regression test for https://github.com/flutter/flutter/issues/146840.
final RenderParagraph child = RenderParagraph(
const TextSpan(text: ''),
textDirection: TextDirection.ltr,
);
final RenderConstraintsTransformBox box = RenderConstraintsTransformBox(
alignment: Alignment.center,
textDirection: TextDirection.ltr,
constraintsTransform: (BoxConstraints constraints) => constraints.copyWith(maxWidth: double.infinity),
child: child,
);

layout(box, constraints: BoxConstraints.tight(Size.zero), phase: EnginePhase.paint);
expect(box, paints..paragraph());
});
});

test ('getMinIntrinsicWidth error handling', () {
Expand Down

[8]ページ先頭

©2009-2026 Movatter.jp