MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / generateMulticolumn

Method generateMulticolumn

src/atom/atom_impl.cpp:291–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291sptr<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
315MatrixAtom::MatrixAtom(
316 bool ispar, const sptr<ArrayOfAtoms>& arr, const wstring& options, bool spaceAround) {

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
getWidthMethod · 0.45
createBoxMethod · 0.45

Tested by

no test coverage detected