automaticValuePosition method

  1. @override
ValuePosition automaticValuePosition(
  1. PdfPoint point,
  2. PdfPoint size,
  3. PdfPoint? previous,
  4. PdfPoint? next,
)
override

Implementation

@override
ValuePosition automaticValuePosition(
  PdfPoint point,
  PdfPoint size,
  PdfPoint? previous,
  PdfPoint? next,
) {
  if (point.y - size.y - delta < box!.bottom) {
    return ValuePosition.top;
  }

  if (previous != null &&
      previous.y > point.y &&
      next != null &&
      next.y > point.y) {
    return ValuePosition.bottom;
  }

  if (previous != null &&
      previous.y < point.y &&
      next != null &&
      next.y > point.y) {
    return ValuePosition.left;
  }

  if (previous != null &&
      previous.y > point.y &&
      next != null &&
      next.y < point.y) {
    return ValuePosition.right;
  }

  return super.automaticValuePosition(point, size, previous, next);
}