getLineLayout method

  1. @override
({int width, int xOffset})? getLineLayout(
  1. double lineY,
  2. double lineHeight
)
override

Gets the layout parameters (width and x-offset) for a line at a specific Y position. Returns null if the line is outside the displayable area.

Implementation

@override
({int width, int xOffset})? getLineLayout(double lineY, double lineHeight) {
  if (lineY < 0 || lineY + lineHeight > height) {
    return null; // Line is outside the vertical bounds.
  }
  return (width: width, xOffset: 0);
}