Make mn handle italic correction and skew like mn does.

This commit is contained in:
Davide P. Cervone 2015-03-17 07:09:06 -04:00
parent 0020f2a822
commit 6478163a39

View File

@ -1356,7 +1356,22 @@
node = this.CHTMLdefaultNode(node);
var bbox = this.CHTML, text = this.data.join("");
if (bbox.skew != null && text.length !== 1) delete bbox.skew;
if (bbox.r > bbox.w && text.length === 1 /*&& !variant.noIC*/) { // ### FIXME: handle variants
if (bbox.r > bbox.w && text.length === 1 && !this.CHTMLvariant.noIC) {
bbox.ic = bbox.r - bbox.w; bbox.w = bbox.r;
node.lastChild.style.paddingRight = CHTML.Em(bbox.ic);
}
return node;
}
});
/********************************************************/
MML.mn.Augment({
toCommonHTML: function (node) {
node = this.CHTMLdefaultNode(node);
var bbox = this.CHTML, text = this.data.join("");
if (bbox.skew != null && text.length !== 1) delete bbox.skew;
if (bbox.r > bbox.w && text.length === 1 && !this.CHTMLvariant.noIC) {
bbox.ic = bbox.r - bbox.w; bbox.w = bbox.r;
node.lastChild.style.paddingRight = CHTML.Em(bbox.ic);
}