| 289 | } |
| 290 | |
| 291 | sptr<Box> MatrixAtom::generateMulticolumn( |
| 292 | _out_ TeXEnvironment& env, |
| 293 | const sptr<Box>& b, |
| 294 | const float* hsep, const float* colWidth, int i, int j) { |
| 295 | float w = 0; |
| 296 | MulticolumnAtom* mca = (MulticolumnAtom*)(_matrix->_array[i][j].get()); |
| 297 | int k, n = mca->getSkipped(); |
| 298 | for (k = j; k < j + n - 1; k++) { |
| 299 | w += colWidth[k] + hsep[k + 1]; |
| 300 | auto it = _vlines.find(k + 1); |
| 301 | if (it != _vlines.end()) w += it->second->getWidth(env); |
| 302 | } |
| 303 | w += colWidth[k]; |
| 304 | |
| 305 | if (mca->isNeedWidth() && mca->getColumnWidth() <= PREC) { |
| 306 | mca->setColumnWidth(w); |
| 307 | return mca->createBox(env); |
| 308 | } |
| 309 | |
| 310 | if (b->_width >= w) return b; |
| 311 | |
| 312 | return sptr<Box>(new HorizontalBox(b, w, mca->getAlign())); |
| 313 | } |
| 314 | |
| 315 | MatrixAtom::MatrixAtom( |
| 316 | bool ispar, const sptr<ArrayOfAtoms>& arr, const wstring& options, bool spaceAround) { |