normalizeVerticalAnchor method

  1. @protected
_PixelVerticalDirection normalizeVerticalAnchor(
  1. TickLabelAnchor anchor,
  2. bool isFirst,
  3. bool isLast
)

Implementation

@protected
_PixelVerticalDirection normalizeVerticalAnchor(
    TickLabelAnchor anchor, bool isFirst, bool isLast) {
  switch (anchor) {
    case TickLabelAnchor.before:
      return _PixelVerticalDirection.under;
    case TickLabelAnchor.after:
      return _PixelVerticalDirection.over;
    case TickLabelAnchor.inside:
      if (isFirst) {
        return _PixelVerticalDirection.over;
      }
      if (isLast) {
        return _PixelVerticalDirection.under;
      }
      return _PixelVerticalDirection.center;
    case TickLabelAnchor.centered:
    default:
      return _PixelVerticalDirection.center;
  }
}