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:
      return PixelVerticalDirection.center;
  }
}