# MathJax zoom overflows its box for long equations #423

Closed
opened this issue Mar 26, 2013 · 15 comments

Projects
None yet
3 participants

### maplemuse commented Mar 26, 2013

 With a long, linebroken equation, the zoom feature has some poor rendering. http://jsfiddle.net/Cfrrf/9/ The zoomed equation is not contained within the bounding box, and is cropped. This may be a result of being within an iframe, but this is a valid use case.
Member

### dpvc commented Mar 26, 2013

 Looks like a Mobile Safari issue. It is supposed to be clipped to the grey zoom box and get scroll bars, but apparently that isn't happening in Mobile Safari (it does in desktop Safari, Chrome, Firefox, and on Android browser, at least). I'll have to look into it.
Author

### maplemuse commented Mar 26, 2013

 The screenshot is from Chrome on Windows 7. Also occurs in FireFox on XP.
Member

### dpvc commented Mar 26, 2013

 OK, I'll check into those as well. It works for me on Mac OS X, but I'll check the Windows versions you indicate.
Member

### dpvc commented Mar 26, 2013

 I'm not able to reproduce your output. I get the expected scroll bars with the text properly restricted to the zoom box, which scrolls to reveal the material to the right. So that is as I would expect it to work. The only issue I have is that the left-hand side is shifted as in your image, so that is a problem. I tested with Chrome on Windows 7 and Firefox on Windows 7 and Windows XP. Same results in both places. Note sure why you are seeing the text slip out of the zoom box. Do you have any extensions or custom CSS stylesheets that could be affecting that?
Author

### maplemuse commented Mar 27, 2013

 Just tested this on an XP VM. Firefox seems to render within the zoom box, but Chrome still extends beyond the box with this example. I'm not sure if the math scaling of 130% (and zoom scaling of 200%) is relevant. I'm not loading any additional css styles. The image fonts have been disabled, if that matters.
Member

### dpvc commented Mar 27, 2013

 What version of Chrome are you using?
Author

### maplemuse commented Mar 27, 2013

 25.0.1364.172 m. Just updated to 26.0.1410.43 m, where the problem still exists. The result iframe in the jfiddle is 700 pixels wide.  ....SNIP.... There is clearly a difference between the width of the overlay and the zoom box. overflow is also being set to visible. If I manually tweak that to scroll, at least the content stays within the zoom box.
Member

### pkra commented Mar 27, 2013

 @maplemuse which browser versions are you on?
Author

### maplemuse commented Mar 27, 2013

 @pkra Chrome 26.0.1410.43 m, Firefox 19.0.2. Both on Windows 7 exhibit the zoom overlay problem.
Member

### dpvc commented Mar 27, 2013

 The overlay is a transparent background that is used to trap click events and close the zoom box, so its width and height should be that of the window (or iframe in this case). It should not match the zoom box itself. Clearly the issue is the overflow:visible. There is a check to see if the zoom box is smaller than its maximum width and hight, and if so, its overflow is set to visible, so I suspect that is the cause of the trouble in this case. It may be that the content is ending up zero width and height (perhaps the content hasn't repainted yet), and the overflow is being changed inappropriately. I'm still only able to reproduce the issue in Mobile Safari, so I guess I may have to use that as the testing environment. I'll keep looking into it. I suppose for now you could add MathJax.Hub.Config({ MathZoom: { styles: { "#MathJax_Zoom": { overflow: "auto ! important" } } } });  to override the overflow:visible that MathJax is applying.
Member

### dpvc commented Mar 27, 2013

 (Sorry, submitted the comment too soon, so if it came through incomplete, see the GitHub site for the complete message).
Author

### maplemuse commented Mar 27, 2013

 @dpvc That does seem to be a workaround for the overflow. Any idea on what is causing the left shift?
Member

### dpvc commented Mar 28, 2013

 Any idea on what is causing the left shift? Not yet. I haven't had the chance to look into it yet.

Member

### dpvc commented Apr 11, 2014

 I believe that I have taken care of this in the zoom-fix branch of my fork of MathJax (along with some other zoom problems).

### dpvc pushed a commit to dpvc/MathJax that referenced this issue Apr 11, 2014

 Merge branch 'zoom-fix' into develop. Issues mathjax#749, mathjax#460, … 
…mathjax#423.
 1e8ae72 

Member

### dpvc commented Apr 11, 2014

 => Merged.

Closed