Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: sky/sdk/lib/rendering/flex.dart

Issue 1200233002: Use the baseline information exposed by C++ to pipe baseline data through RenderBox. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | sky/sdk/lib/rendering/paragraph.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/rendering/flex.dart
diff --git a/sky/sdk/lib/rendering/flex.dart b/sky/sdk/lib/rendering/flex.dart
index e883e51612b6cd1eb8177098dd9e213c9edde22f..4eee1bd854f656ec197e50fd8fe62c4d044d35af 100644
--- a/sky/sdk/lib/rendering/flex.dart
+++ b/sky/sdk/lib/rendering/flex.dart
@@ -110,6 +110,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
} else {
inflexibleSpace += childSize(child, childConstraints);
}
+ assert(child.parentData is FlexBoxParentData);
child = child.parentData.nextSibling;
}
double mainSize = maxFlexFractionSoFar * totalFlex + inflexibleSpace;
@@ -172,6 +173,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
inflexibleSpace += mainSize;
maxCrossSize = math.max(maxCrossSize, crossSize);
}
+ assert(child.parentData is FlexBoxParentData);
child = child.parentData.nextSibling;
}
@@ -199,6 +201,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
}
maxCrossSize = math.max(maxCrossSize, crossSize);
}
+ assert(child.parentData is FlexBoxParentData);
child = child.parentData.nextSibling;
}
@@ -243,6 +246,13 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
childSize: (c, innerConstraints) => c.getMaxIntrinsicHeight(innerConstraints));
}
+ double getDistanceToActualBaseline(TextBaseline baseline) {
+ assert(!needsLayout);
+ if (_direction == FlexDirection.horizontal)
+ return defaultGetDistanceToHighestActualBaseline(baseline);
+ return defaultGetDistanceToFirstActualBaseline(baseline);
+ }
+
int _getFlex(RenderBox child) {
assert(child.parentData is FlexBoxParentData);
return child.parentData.flex != null ? child.parentData.flex : 0;
@@ -267,6 +277,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
double freeSpace = mainSize;
RenderBox child = firstChild;
while (child != null) {
+ assert(child.parentData is FlexBoxParentData);
totalChildren++;
int flex = _getFlex(child);
if (flex > 0) {
@@ -306,6 +317,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
usedSpace += _getMainSize(child);
crossSize = math.max(crossSize, _getCrossSize(child));
}
+ assert(child.parentData is FlexBoxParentData);
child = child.parentData.nextSibling;
}
@@ -352,6 +364,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
double childMainPosition = leadingSpace;
child = firstChild;
while (child != null) {
+ assert(child.parentData is FlexBoxParentData);
double childCrossPosition;
switch (_alignItems) {
case FlexAlignItems.flexStart:
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | sky/sdk/lib/rendering/paragraph.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698