Merge branch 'issue835' into develop. Issue #835.

This commit is contained in:
Davide P. Cervone 2014-09-14 09:21:44 -04:00
commit ca196c8e0d
2 changed files with 20 additions and 1 deletions

View File

@ -794,13 +794,22 @@
}
}
//
// Adjust margins to prevent overlaps at the edges
//
var child = span.firstChild.firstChild.style;
if (bbox.H != null && bbox.H > bbox.h)
{child.marginTop = HTMLCSS.Em(bbox.H-Math.max(bbox.h,HTMLCSS.FONTDATA.lineH))}
if (bbox.D != null && bbox.D > bbox.d)
{child.marginBottom = HTMLCSS.Em(bbox.D-Math.max(bbox.d,HTMLCSS.FONTDATA.lineD))}
if (bbox.lw < 0) {child.paddingLeft = HTMLCSS.Em(-bbox.lw)}
if (bbox.rw > bbox.w) {child.marginRight = HTMLCSS.Em(bbox.rw-bbox.w)}
//
// Get height and width of zoomed math and original math
//
span.style.position = "absolute";
if (!width) {math.style.position = "absolute"}
var zW = span.offsetWidth, zH = span.offsetHeight,
mH = math.offsetHeight, mW = math.offsetWidth;
if (mW === 0) {mW = math.parentNode.offsetWidth}; // IE7 gets mW == 0?
span.style.position = math.style.position = "";
//
return {Y:-EVENT.getBBox(span).h, mW:mW, mH:mH, zW:zW, zH:zH};
@ -2806,6 +2815,8 @@
var p = 1/HTMLCSS.em, f = HTMLCSS.em / HTMLCSS.outerEm; HTMLCSS.em /= f;
span.bbox.h *= f; span.bbox.d *= f; span.bbox.w *= f;
span.bbox.lw *= f; span.bbox.rw *= f;
if (span.bbox.H) {span.bbox.H *= f}
if (span.bbox.D) {span.bbox.D *= f}
if (math && math.bbox.width != null) {
span.style.minWidth = (math.bbox.minWidth || span.style.width);
span.style.width = math.bbox.width;

View File

@ -442,6 +442,14 @@
this.zoomScale = 1;
span.removeChild(this.textSVG);
//
// Don't allow overlaps on any edge
//
var svg = span.getElementsByTagName("svg")[0].style;
svg.marginTop = svg.marginRight = svg.marginLeft = 0;
if (svg.marginBottom.charAt(0) === "-")
span.style.marginBottom = svg.marginBottom.substr(1);
if (this.operaZoomRefresh)
{setTimeout(function () {span.firstChild.style.border="1px solid transparent"},1)}
//