Repository navigation
_cachedBaselines not clear when relayout #101179
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: layoutSystemChrome and Framework's Layout IssuesSystemChrome and Framework's Layout Issuesfound in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
@override
void markNeedsLayout() {
if ((_cachedBaselines != null && _cachedBaselines!.isNotEmpty) ||
(_cachedIntrinsicDimensions != null && _cachedIntrinsicDimensions!.isNotEmpty) ||
(_cachedDryLayoutSizes != null && _cachedDryLayoutSizes!.isNotEmpty)) {
// If we have cached data, then someone must have used our data.
// Since the parent will shortly be marked dirty, we can forget that they
// used the baseline and/or intrinsic dimensions. If they use them again,
// then we'll fill the cache again, and if we get dirty again, we'll
// notify them again.
**_cachedBaselines?.clear();**
_cachedIntrinsicDimensions?.clear();
_cachedDryLayoutSizes?.clear();
if (parent is RenderObject) {
markParentNeedsLayout();
return;
}
}
super.markNeedsLayout();
}
_cachedBaselines only be cleared in markNeedsLayout,but i think it should also be cleared in layout(when parent relayout it,)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: layoutSystemChrome and Framework's Layout IssuesSystemChrome and Framework's Layout Issuesfound in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.13Found to occur in 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Activity
hackware1993 commentedon Apr 1, 2022
I'm writing a custom layout with RenderBox, this layout will use the baseline of the child element, when I change the size of the child element and re-layout it, I still get the old baseline. This is wrong. Child elements should recalculate the baseline based on the new self size.
darshankawar commentedon Apr 1, 2022
@hackware1993
Please provide
flutter doctor -v, a complete runnable but minimal reproducible code sample along with expected vs actual result.Thanks.
hackware1993 commentedon Apr 1, 2022
flutter version: v2.10.3 stable
darshankawar commentedon Apr 1, 2022
@hackware1993
Also
a complete runnable but minimal reproducible code sampleas requested earlier.hackware1993 commentedon Apr 2, 2022
My temporary solution is to change the source code of the local flutter framework.
darshankawar commentedon Apr 4, 2022
Keeping this open and labeling for further investigation from the team.
6 remaining items
xu-baolin commentedon Apr 7, 2022
Repro Steps
1, Run the code on a desktop platform
2, Resize the app window
3, Observer the placeholder position
Expect
20220407_114446.mp4
Actual
20220407_114740.mp4
Code
github-actions commentedon May 20, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.