Skip to content

Commit 2613461

Browse files
authored
Merge pull request #1353 from mathjax/issue3423
Allow stretched character to increase column size (e.g., if it has minsize). (mathjax/MathJax#3423)
2 parents 59a9b65 + 2624516 commit 2613461

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ts/output/common/Wrappers/mtable.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -690,14 +690,13 @@ export function CommonMtableMixin<
690690
}
691691
}
692692
const count = stretchy.length;
693-
const nodeCount = this.childNodes.length;
694-
if (count && nodeCount > 1 && W === null) {
693+
if (count && W === null) {
695694
W = 0;
696695
//
697696
// If all the children are stretchy, find the largest one,
698697
// otherwise, find the width of the non-stretchy children.
699698
//
700-
const all = count > 1 && count === nodeCount;
699+
const all = count === this.childNodes.length;
701700
for (const row of this.tableRows) {
702701
const cell = row.getChild(i);
703702
if (cell) {
@@ -716,12 +715,15 @@ export function CommonMtableMixin<
716715
//
717716
// Stretch the stretchable children
718717
//
718+
const TW = this.getTableData().W;
719719
for (const child of stretchy) {
720+
const w = child.getBBox().w;
720721
child
721722
.coreMO()
722-
.getStretchedVariant([
723-
Math.max(W, child.getBBox().w) / child.coreRScale(),
724-
]);
723+
.getStretchedVariant([Math.max(W, w) / child.coreRScale()]);
724+
if (w > TW[i]) {
725+
TW[i] = w;
726+
}
725727
}
726728
}
727729
}

0 commit comments

Comments
 (0)