computeDistanceToActualBaseline method

double computeDistanceToActualBaseline (TextBaseline baseline)

Returns the distance from the top of the text to the first baseline of the given type.

Valid only after layout has been called.

Implementation

double computeDistanceToActualBaseline(TextBaseline baseline) {
  assert(!_needsLayout);
  assert(baseline != null);
  switch (baseline) {
    case TextBaseline.alphabetic:
      return _paragraph.alphabeticBaseline;
    case TextBaseline.ideographic:
      return _paragraph.ideographicBaseline;
  }
  return null;
}