cool-musician-79004
05/24/2023, 5:58 PMbright-gpu-74537
05/24/2023, 6:08 PMbright-yak-48460
05/24/2023, 7:11 PMbulky-exabyte-6537
05/25/2023, 6:30 AMhaxe
function this_SHOWN(e) {
#if js
// rewrites the dom to replace special markup text with math symbols
mathjax.MathJax.typeset();
#end
}
but the sad part is that haxeui doesn't update the layout to the new size and i'm not sure how to tell it to. invalidateComponent
doesn't work in this case.
xml
<button text="SADSADASDADSADS"/>
<label text="`sum_(i=1)^n i^3=((n(n+1))/2)^2`"/>
<button text="below"/>
https://cdn.discordapp.com/attachments/565569107701923852/1111179374939611197/image.png▾
bulky-exabyte-6537
05/25/2023, 6:59 AMhaxe
#if js
mathjax.MathJax.typeset();
math.width = math.element.children[0].children[0].children[0].clientWidth;
math.height = math.element.children[0].children[0].children[0].clientHeight;
#end
bright-gpu-74537
05/25/2023, 7:37 AMbright-gpu-74537
05/25/2023, 7:42 AMbulky-exabyte-6537
05/25/2023, 7:47 AMbulky-exabyte-6537
05/25/2023, 7:54 AMbulky-exabyte-6537
05/25/2023, 7:55 AMbulky-exabyte-6537
05/25/2023, 8:00 AMbright-gpu-74537
05/25/2023, 8:19 AMbright-gpu-74537
05/25/2023, 8:19 AMbright-gpu-74537
05/25/2023, 8:20 AMxml
<vbox style="padding: 5px;" width="100%" height="100%">
<button text="SADSADASDADSADS"/>
<mj text="`sum_(i=1)^n i^3=((n(n+1))/2)^2`" />
<button text="below"/>
<mj text="`i^123`"/>
<grid columns="3">
<button text="TL" />
<button text="T" width="100%" />
<button text="TR" />
<button text="L" width="100%" height="100%" />
<mj text="`sum_(i=1)^n i^3=((n(n+1))/2)^2`" />
<button text="R" width="100%" height="100%" />
<button text="BL" />
<button text="B" width="100%" />
<button text="BR" />
</grid>
</vbox>
bright-gpu-74537
05/25/2023, 8:20 AMhttps://cdn.discordapp.com/attachments/565569107701923852/1111207139046850569/image.png▾
bulky-exabyte-6537
05/25/2023, 8:33 AMbright-gpu-74537
05/25/2023, 8:35 AMbulky-exabyte-6537
05/25/2023, 8:44 AMbright-gpu-74537
05/25/2023, 9:03 AMbright-gpu-74537
05/25/2023, 9:07 AMbright-gpu-74537
05/25/2023, 9:09 AMbright-gpu-74537
05/25/2023, 9:09 AMhaxe
private override function set_text(value:String):String {
this.width = null;
this.height = null;
this.element.style.removeProperty("width");
this.element.style.removeProperty("height");
this.element.innerHTML = value;
if (isReady) {
MathJax.typeset();
this.invalidateComponentLayout();
}
return super.set_text(value);
}
bright-gpu-74537
05/25/2023, 9:13 AMhttps://cdn.discordapp.com/attachments/565569107701923852/1111220592738308107/resize-mathjax.gif▾
bulky-exabyte-6537
05/25/2023, 11:21 PMadorable-spring-93492
05/26/2023, 2:16 AMadorable-spring-93492
05/26/2023, 2:17 AMbright-gpu-74537
05/26/2023, 6:25 AMbulky-exabyte-6537
05/26/2023, 9:27 AMhttps://cdn.discordapp.com/attachments/565569107701923852/1111586511465488444/image.png▾
bulky-exabyte-6537
05/26/2023, 9:29 AMbulky-exabyte-6537
05/26/2023, 9:31 AM