Skip to content

Commit

Permalink
Merge pull request #467 from mathjax/issue2394
Browse files Browse the repository at this point in the history
Fix row alignment for negative row numbers.  (mathjax/MathJax#2394)
  • Loading branch information
dpvc committed Apr 3, 2020
2 parents 3ac05cc + 885c73b commit a926b59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ts/output/common/Wrappers/mtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ export function CommonMtableMixin<C extends AnyWrapper,
* The parent node of this table (skipping non-parents and mrows)
* and the position of the table as a child node
*/
container: AnyWrapper;
containerI: number;
public container: AnyWrapper;
public containerI: number;

/**
* The spacing and line data
Expand Down Expand Up @@ -721,7 +721,7 @@ export function CommonMtableMixin<C extends AnyWrapper,
/**
* Get bbox left and right amounts to cover labels
*/
getBBoxLR() {
public getBBoxLR() {
if (this.hasLabels) {
const side = this.node.attributes.get('side') as string;
const [pad, align, shift] = this.getPadAlignShift(side);
Expand Down Expand Up @@ -945,7 +945,7 @@ export function CommonMtableMixin<C extends AnyWrapper,
//
// For equal rows, get updated height and depth
//
const [h, d] = (equal ? [(HD + H[i] - D[i]) / 2, (HD - H[i] + D[i])/2] : [H[i], D[i]]);
const [h, d] = (equal ? [(HD + H[i] - D[i]) / 2, (HD - H[i] + D[i]) / 2] : [H[i], D[i]]);
//
// Add the offset into the specified row
//
Expand Down Expand Up @@ -1009,7 +1009,7 @@ export function CommonMtableMixin<C extends AnyWrapper,
const [align, row] = split(this.node.attributes.get('align') as string);
if (row == null) return [align, null];
let i = parseInt(row);
if (i < 0) i += this.numRows;
if (i < 0) i += this.numRows + 1;
return [align, i < 1 || i > this.numRows ? null : i - 1];
}

Expand Down

0 comments on commit a926b59

Please sign in to comment.