getOffset method

Offset getOffset(
  1. int column,
  2. int row
)

Calculates the top-left offset of a cell at the given position.

Computes the cumulative offset by summing all column widths before the target column and all row heights before the target row.

Parameters:

  • column (int, required): Zero-based column index
  • row (int, required): Zero-based row index

Returns Offset representing the cell's position relative to table origin.

Implementation

Offset getOffset(int column, int row) {
  double x = 0;
  for (int i = 0; i < column; i++) {
    x += columnWidths[i];
  }
  double y = 0;
  for (int i = 0; i < row; i++) {
    y += rowHeights[i];
  }
  return Offset(x, y);
}