Work around WebKit bug with SVG sizes. Resolves issue #749.
This commit is contained in:
parent
6ba5f2a624
commit
46ba400ad6
|
@ -222,10 +222,12 @@
|
||||||
// Set the position of the zoom box and overlay
|
// Set the position of the zoom box and overlay
|
||||||
//
|
//
|
||||||
Position: function (zoom,bbox) {
|
Position: function (zoom,bbox) {
|
||||||
|
zoom.style.display = "none"; // avoids getting excessive width in Resize()
|
||||||
var XY = this.Resize(), x = XY.x, y = XY.y, W = bbox.mW;
|
var XY = this.Resize(), x = XY.x, y = XY.y, W = bbox.mW;
|
||||||
|
zoom.style.display = "";
|
||||||
var dx = -W-Math.floor((zoom.offsetWidth-W)/2), dy = bbox.Y;
|
var dx = -W-Math.floor((zoom.offsetWidth-W)/2), dy = bbox.Y;
|
||||||
zoom.style.left = Math.max(dx,10-x)+"px"; zoom.style.top = Math.max(dy,10-y)+"px";
|
zoom.style.left = Math.max(dx,10-x)+"px"; zoom.style.top = Math.max(dy,10-y)+"px";
|
||||||
setTimeout(ZOOM.Resize); // refigure overlay position and size
|
if (!ZOOM.msiePositionBug) {ZOOM.SetWH()} // refigure overlay width/height
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -249,10 +251,11 @@
|
||||||
},
|
},
|
||||||
SetWH: function () {
|
SetWH: function () {
|
||||||
var overlay = document.getElementById("MathJax_ZoomOverlay");
|
var overlay = document.getElementById("MathJax_ZoomOverlay");
|
||||||
overlay.style.width = overlay.style.height = "1px"; // so scrollWidth/Height will be right below
|
overlay.style.display = "none"; // so scrollWidth/Height will be right below
|
||||||
var doc = overlay.scroll_parent || document.documentElement || document.body;
|
var doc = overlay.scroll_parent || document.documentElement || document.body;
|
||||||
overlay.style.width = doc.scrollWidth + "px";
|
overlay.style.width = doc.scrollWidth + "px";
|
||||||
overlay.style.height = Math.max(doc.clientHeight,doc.scrollHeight) + "px";
|
overlay.style.height = Math.max(doc.clientHeight,doc.scrollHeight) + "px";
|
||||||
|
overlay.style.display = "";
|
||||||
},
|
},
|
||||||
findContainer: function (obj) {
|
findContainer: function (obj) {
|
||||||
var obj = obj.parentNode;
|
var obj = obj.parentNode;
|
||||||
|
|
|
@ -425,6 +425,13 @@
|
||||||
if (this.operaZoomRefresh)
|
if (this.operaZoomRefresh)
|
||||||
{setTimeout(function () {span.firstChild.style.border="1px solid transparent"},1)}
|
{setTimeout(function () {span.firstChild.style.border="1px solid transparent"},1)}
|
||||||
//
|
//
|
||||||
|
// WebKit bug (issue #749)
|
||||||
|
//
|
||||||
|
if (span.offsetWidth < span.firstChild.offsetWidth) {
|
||||||
|
span.style.minWidth = span.firstChild.offsetWidth + "px";
|
||||||
|
math.style.minWidth = math.firstChild.offsetWidth + "px";
|
||||||
|
}
|
||||||
|
//
|
||||||
// Get height and width of zoomed math and original math
|
// Get height and width of zoomed math and original math
|
||||||
//
|
//
|
||||||
span.style.position = math.style.position = "absolute";
|
span.style.position = math.style.position = "absolute";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user