Skip to content

Commit 2bde9c8

Browse files
committed
Allow stretched character to increase column size (e.g., if it has minsize). (mathjax/MathJax#3423)
1 parent afaf1ea commit 2bde9c8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ts/output/common/Wrappers/mtable.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,13 @@ export function CommonMtableMixin<
701701
}
702702
}
703703
const count = stretchy.length;
704-
const nodeCount = this.childNodes.length;
705-
if (count && nodeCount > 1 && W === null) {
704+
if (count && W === null) {
706705
W = 0;
707706
//
708707
// If all the children are stretchy, find the largest one,
709708
// otherwise, find the width of the non-stretchy children.
710709
//
711-
const all = count > 1 && count === nodeCount;
710+
const all = count === this.childNodes.length;
712711
for (const row of this.tableRows) {
713712
const cell = row.getChild(i);
714713
if (cell) {
@@ -727,12 +726,17 @@ export function CommonMtableMixin<
727726
//
728727
// Stretch the stretchable children
729728
//
729+
const TW = this.getTableData().W;
730730
for (const child of stretchy) {
731731
child
732732
.coreMO()
733733
.getStretchedVariant([
734734
Math.max(W, child.getBBox().w) / child.coreRScale(),
735735
]);
736+
const w = child.getBBox().w;
737+
if (w > TW[i]) {
738+
TW[i] = w;
739+
}
736740
}
737741
}
738742
}

0 commit comments

Comments
 (0)