From 7764748a631a0b79d2f1b0b37ba30a06af0bb366 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sun, 8 Mar 2015 09:48:49 -0400 Subject: [PATCH] Get position of overscript correct, and don't combine bboxes unnecessarily. --- unpacked/jax/output/CommonHTML/jax.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index 7c2893b53..febd04594 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -1151,7 +1151,7 @@ // Get the maximum width // for (i = 0; i < m; i++) { - bbox[i] = this.CHTMLbboxFor(i); + bbox[i] = this.CHTMLbboxFor(i); bbox[i].x = bbox[i].y = 0; if (this.data[i]) bbox[i].stretch = this.data[i].CHTMLcanStretch("Horizontal"); SCALE = (i === this.base ? 1 : i === this.over ? values.oscale : values.uscale); W = Math.max(W,SCALE*(bbox[i].w + (bbox[i].L||0) + (bbox[i].R||0))); @@ -1206,7 +1206,7 @@ z2 = CHTML.TEX.big_op_spacing3; k = Math.max(z1,z2-Math.max(0,scale*obox.d)); } - obox.x += delta/2; obox.y = BBOX.h + k + z3; + obox.x += delta/2; obox.y = BBOX.h + k + z3 + scale*obox.d; // // Position the overscript // @@ -1270,12 +1270,14 @@ if (boxes[i].x < dx) dx = boxes[i].x; } for (i = 0; i < m; i++) { - var SCALE = (i === this.base ? 1 : i === this.over ? values.oscale : values.uscale); - if (boxes[i].x - dx) { - var node = (i === this.base ? base : i === this.over ? over : under); - node.style.paddingLeft = CHTML.Em((boxes[i].x-dx)/SCALE); + if (this.data[i]) { + var SCALE = (i === this.base ? 1 : i === this.over ? values.oscale : values.uscale); + if (boxes[i].x - dx) { + var node = (i === this.base ? base : i === this.over ? over : under); + node.style.paddingLeft = CHTML.Em((boxes[i].x-dx)/SCALE); + } + CHTML.combineBBoxes(BBOX,boxes[i],boxes[i].x-dx,boxes[i].y,SCALE); } - CHTML.combineBBoxes(BBOX,boxes[i],boxes[i].x-dx,boxes[i].y,SCALE) } } });