Commit 68cff6bf authored by Ian Hickson's avatar Ian Hickson

Merge pull request #2114 from Hixie/box-debug

Trivial cleanup of getDistanceToBaseline
parents 8a537534 16e7c3a6
...@@ -533,19 +533,19 @@ abstract class RenderBox extends RenderObject { ...@@ -533,19 +533,19 @@ abstract class RenderBox extends RenderObject {
double getDistanceToBaseline(TextBaseline baseline, { bool onlyReal: false }) { double getDistanceToBaseline(TextBaseline baseline, { bool onlyReal: false }) {
assert(!needsLayout); assert(!needsLayout);
assert(!_debugDoingBaseline); assert(!_debugDoingBaseline);
final RenderObject parent = this.parent;
assert(() { assert(() {
final RenderObject parent = this.parent;
if (RenderObject.debugDoingLayout) if (RenderObject.debugDoingLayout)
return (RenderObject.debugActiveLayout == parent) && parent.debugDoingThisLayout; return (RenderObject.debugActiveLayout == parent) && parent.debugDoingThisLayout;
if (RenderObject.debugDoingPaint) if (RenderObject.debugDoingPaint)
return ((RenderObject.debugActivePaint == parent) && parent.debugDoingThisPaint) || return ((RenderObject.debugActivePaint == parent) && parent.debugDoingThisPaint) ||
((RenderObject.debugActivePaint == this) && debugDoingThisPaint); ((RenderObject.debugActivePaint == this) && debugDoingThisPaint);
assert(parent == this.parent);
return false; return false;
}); });
assert(_debugSetDoingBaseline(true)); assert(_debugSetDoingBaseline(true));
double result = getDistanceToActualBaseline(baseline); double result = getDistanceToActualBaseline(baseline);
assert(_debugSetDoingBaseline(false)); assert(_debugSetDoingBaseline(false));
assert(parent == this.parent);
if (result == null && !onlyReal) if (result == null && !onlyReal)
return size.height; return size.height;
return result; return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment