Make global scaling factor available in the HTML-CSS object, and use it in annotation-xml to match the scaling properly
This commit is contained in:
parent
6b06f0ac16
commit
4d06c1026e
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
|
@ -12,5 +12,5 @@
|
|||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a["annotation-xml"].Augment({toHTML:function(f){f=this.HTMLhandleSize(this.HTMLcreateSpan(f));var g=this.Get("encoding");for(var e=0,d=this.data.length;e<d;e++){this.data[e].toHTML(f,g)}this.HTMLhandleSpace(f);this.HTMLhandleColor(f);return f}});a.xml.Augment({toHTML:function(f,g){for(var e=0,d=this.data.length;e<d;e++){f.appendChild(this.data[e].cloneNode(true))}f.bbox.w=b.getW(f);f.bbox.rw=f.bbox.w;var h=b.getHD(f);f.bbox.h=h.h;f.bbox.d=h.d}});MathJax.Hub.Startup.signal.Post("HTML-CSS annotation-xml Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/annotation-xml.js")});
|
||||
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a["annotation-xml"].Augment({toHTML:function(f){f=this.HTMLhandleSize(this.HTMLcreateSpan(f));var g=this.Get("encoding");for(var e=0,d=this.data.length;e<d;e++){this.data[e].toHTML(f,g)}this.HTMLhandleSpace(f);this.HTMLhandleColor(f);return f},HTMLgetScale:function(){return this.SUPER(arguments).HTMLgetScale.call(this)*(100/b.scale)}});a.xml.Augment({toHTML:function(f,g){for(var e=0,d=this.data.length;e<d;e++){f.appendChild(this.data[e].cloneNode(true))}f.bbox.w=b.getW(f);f.bbox.rw=f.bbox.w;var h=b.getHD(f);f.bbox.h=h.h;f.bbox.d=h.d}});MathJax.Hub.Startup.signal.Post("HTML-CSS annotation-xml Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/annotation-xml.js")});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -35,6 +35,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
|||
this.HTMLhandleSpace(span);
|
||||
this.HTMLhandleColor(span);
|
||||
return span;
|
||||
},
|
||||
HTMLgetScale: function () {
|
||||
return this.SUPER(arguments).HTMLgetScale.call(this) * (100/HTMLCSS.scale)
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -487,12 +487,12 @@
|
|||
this.HDMspan.className = "MathJax"; this.HDMspan.id = "MathJax_getScales";
|
||||
this.HDMimg.style.width = "60em";
|
||||
var em = this.outerEm = this.HDMspan.offsetWidth/60;
|
||||
var scale = Math.floor(Math.max(this.config.minScaleAdjust/100,(ex/this.TeX.x_height)/em) * this.config.scale);
|
||||
span.style.fontSize = this.HDMspan.style.fontSize = scale+"%";
|
||||
this.scale = Math.floor(Math.max(this.config.minScaleAdjust/100,(ex/this.TeX.x_height)/em) * this.config.scale);
|
||||
span.style.fontSize = this.HDMspan.style.fontSize = this.scale+"%";
|
||||
this.em = MML.mbase.prototype.em = this.HDMspan.offsetWidth/60;
|
||||
if (this.operaFontSizeBug && em === this.em && scale !== 100) {
|
||||
if (this.operaFontSizeBug && em === this.em && this.scale !== 100) {
|
||||
// Opera 10.61 doesn't seem to process the fontSize setting above, so adjust manually
|
||||
this.em = MML.mbase.prototype.em = em * scale/100;
|
||||
this.em = MML.mbase.prototype.em = em * this.scale/100;
|
||||
}
|
||||
span.parentNode.removeChild(this.HDMspan);
|
||||
this.msieMarginScale = this.getMarginScale(span);
|
||||
|
|
Loading…
Reference in New Issue
Block a user