* Initializes the Cells data structure. * * @param tableOptions - A fully populated set of tableOptions. * In addition to the standard default values, tableOptions must have fully populated the * `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number *
(tableOptions)
| 109 | * |
| 110 | */ |
| 111 | init(tableOptions) { |
| 112 | let x = this.x; |
| 113 | let y = this.y; |
| 114 | this.widths = tableOptions.colWidths.slice(x, x + this.colSpan); |
| 115 | this.heights = tableOptions.rowHeights.slice(y, y + this.rowSpan); |
| 116 | this.width = this.widths.reduce(sumPlusOne, -1); |
| 117 | this.height = this.heights.reduce(sumPlusOne, -1); |
| 118 | |
| 119 | this.hAlign = this.options.hAlign || tableOptions.colAligns[x]; |
| 120 | this.vAlign = this.options.vAlign || tableOptions.rowAligns[y]; |
| 121 | |
| 122 | this.drawRight = x + this.colSpan == tableOptions.colWidths.length; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Draws the given line of the cell. |
no outgoing calls
no test coverage detected