Make Chrome handle horiztonal stretchy characters better so that the ends don't misalign with the middle. This was affecting the overline in the square root, for example. Resolves a second part of issue #295

This commit is contained in:
Davide P. Cervone 2012-08-22 14:52:35 -04:00
parent 76f52f6462
commit 6b87ad787d
8 changed files with 12 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -992,7 +992,7 @@
return box; return box;
}, },
addBox: function (span,box) { addBox: function (span,box) {
box.style.position = "absolute"; box.isBox = true; box.style.position = "absolute"; box.isBox = box.isMathJax = true;
return span.appendChild(box); return span.appendChild(box);
}, },
placeBox: function (span,x,y,noclip) { placeBox: function (span,x,y,noclip) {
@ -1184,7 +1184,7 @@
dx = (n/(n+1))*(rW - rw); rw = rW - dx; x -= rep.bbox.lw + dx; dx = (n/(n+1))*(rW - rw); rw = rW - dx; x -= rep.bbox.lw + dx;
while (k-- > 0) { while (k-- > 0) {
while (n-- > 0) { while (n-- > 0) {
if (!this.msieCloneNodeBug) {REP = rep.cloneNode(true)} if (!this.cloneNodeBug) {REP = rep.cloneNode(true)}
else {REP = this.Element("span"); this.createChar(REP,delim.rep,scale,font)} else {REP = this.Element("span"); this.createChar(REP,delim.rep,scale,font)}
this.placeBox(this.addBox(stack,REP),x,0,true); x += rw; this.placeBox(this.addBox(stack,REP),x,0,true); x += rw;
} }
@ -2308,7 +2308,7 @@
if (surd.bbox.h + surd.bbox.d > H) {q = ((surd.bbox.h+surd.bbox.d) - (H-t))/2} if (surd.bbox.h + surd.bbox.d > H) {q = ((surd.bbox.h+surd.bbox.d) - (H-t))/2}
var ruleC = HTMLCSS.FONTDATA.DELIMITERS[HTMLCSS.FONTDATA.RULECHAR]; var ruleC = HTMLCSS.FONTDATA.DELIMITERS[HTMLCSS.FONTDATA.RULECHAR];
if (!ruleC || W < ruleC.HW[0][0]*scale || scale < .75) { if (!ruleC || W < ruleC.HW[0][0]*scale || scale < .75) {
HTMLCSS.createRule(rule,t,0,W); HTMLCSS.createRule(rule,0,t,W);
} else { } else {
HTMLCSS.createDelimiter(rule,HTMLCSS.FONTDATA.RULECHAR,W,scale); HTMLCSS.createDelimiter(rule,HTMLCSS.FONTDATA.RULECHAR,W,scale);
} }
@ -2696,7 +2696,7 @@
msiePlaceBoxBug: (isIE8 && !quirks), msiePlaceBoxBug: (isIE8 && !quirks),
msieClipRectBug: !isIE8, msieClipRectBug: !isIE8,
msieNegativeSpaceBug: quirks, msieNegativeSpaceBug: quirks,
msieCloneNodeBug: (isIE8 && browser.version === "8.0"), cloneNodeBug: (isIE8 && browser.version === "8.0"),
initialSkipBug: (mode < 8), // confused by initial left-margin values initialSkipBug: (mode < 8), // confused by initial left-margin values
msieNegativeBBoxBug: (mode >= 8), // negative bboxes have positive widths msieNegativeBBoxBug: (mode >= 8), // negative bboxes have positive widths
msieIE6: !isIE7, msieIE6: !isIE7,
@ -2776,6 +2776,7 @@
Em: HTMLCSS.Px, // vertical alignment is better in pixels (since around v20) Em: HTMLCSS.Px, // vertical alignment is better in pixels (since around v20)
unEm: HTMLCSS.unPx, unEm: HTMLCSS.unPx,
chromeHeightBug: true, // heights can be 1px off from the explicitly set size chromeHeightBug: true, // heights can be 1px off from the explicitly set size
cloneNodeBug: true, // Chrome gets heights wrong with the cloned ones
rfuzz: .011, rfuzz: .011,
AccentBug: true, AccentBug: true,
AdjustSurd: true, AdjustSurd: true,