Lively Kernel canvas
Draft40true
sav0rfalsenulltruetruenull
ThisisaTextMorph,anditcontainsalotofText.Thus,morelines.1
Inoldentimeswhenwishingstillhelpedone,therelivedakingwhosedaughterswereallbeautiful;andtheyoungestwassobeautifulthatthesunitself,whichhasseensomuch,wasastonishedwheneveritshoneinherface.Closebytheking'scastlelayagreatdarkforest,andunderanoldlime-treeintheforestwasawell,andwhenthedaywasverywarm,theking'schildwentouttotheforestandsatdownbythefountain;andwhenshewasboredshetookagoldenball,andthrewituponhighandcaughtit;andthisballwasherfavoriteplaything.11
ThisisaTextMorph,anditcontainsalotofText.Thus,morelines.
2
Linebreak
In olden times when wishing still helped one, there lived a king whosedaughters were all beautiful; and the youngest was so beautiful that the sunitself, which has seen so much, was astonished whenever it shone in her face.Close by the king's castle lay a great dark forest, and under an old lime-treein the forest was a well, and when the day was very warm, the king's childwent out to the forest and sat down by the fountain; and when she was boredshe took a golden ball, and threw it up on high and caught it; and this ballwas her favorite plaything.
7
createLayer("TeXToleranceVisualizationLayer");layerClass(TeXToleranceVisualizationLayer,TextMorph,{renderText:function(proceed,t,w){varresult;result=proceed(t,w);vary=t.y-5;varx=t.x;varrnode=NodeFactory.create("tspan");this.textContent.rawNode.appendChild(rnode);rnode.appendChild(NodeFactory.createText(""+this.net.config.tolerance));rnode.setAttributeNS(null,"x",x);rnode.setAttributeNS(null,"y",y);returnresult;},});truetruefalse15truetrue
false00.11truefalsenulltruetrue
nullfalsetruenull
VisualizingTolerancefalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
createLayer("TeXBoxVisualizationLayer");layerClass(TeXBoxVisualizationLayer,TextMorph,{renderText:function(proceed,t,w){varresult;result=proceed(t,w);this.boxes=[];this.net.nodes.forEach(function(value){if(!!value.bounds){varm;if(valueinstanceofprojects.TeX.TeX.Box){m=Morph.makeRectangle(value.bounds);m.setFill(null);}if(valueinstanceofprojects.TeX.TeX.Glue){varhalfheight=value.bounds.height/2;m=Morph.makeRectangle(value.bounds.withY(value.bounds.y+halfheight).withHeight(halfheight));m.setFill(Color.tangerine);}m.suppressHandles=true;m.suppressGrabbing=true;this.boxes.push(m);this.addMorphBack(m);}},this);returnresult;},resetRendering:function(proceed){this.boxes.forEach(function(box){this.removeMorph(box)},this);proceed();},});truetruefalse6truetrue
false00.11truefalsenulltruetrue
nullfalsetruenull
VisualizingBoxesfalsenulltruefalse
false
false
falsenullfalsefalsenullnullnullnullfalse
false1truefalsenull
createLayer("TeXRatioVisualizationLayer");layerClass(TeXRatioVisualizationLayer,projects.TeX.TeX.Line,{render:function(proceed,textContent){proceed(textContent);vary=this.topLeft.y+this.currentFont.getBaselineHeight();varx=this.topLeft.x+this.compositionWidth+10;varrnode=NodeFactory.create("tspan");textContent.rawNode.appendChild(rnode);rnode.appendChild(NodeFactory.createText(""+this.ratio.toFixed(3)));rnode.setAttributeNS(null,"x",x);rnode.setAttributeNS(null,"y",y);},});layerClass(TeXRatioVisualizationLayer,TextMorph,{renderText:function(proceed,t,w){varresult;withLayers([TeXRatioVisualizationLayer],function(){result=proceed(t,w);});returnresult;},});truetruefalsenull21truetruefalsetruetruefalse
nullfalsetruenullfalse
VisualizingRatiofalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
module('projects.TeX.TeX').load()$m=$morph('debugText');$m=$morph('debugTeX');$m=$morph('debugCR');$m.renderText($m.textTopLeft(),$m.compositionWidth());$m.resetRendering();$m.setWithLayers([]);$m.setWithLayers([TeXLayer]);$m.setWithLayers([TeXLayer,TeXRatioVisualizationLayer]);$m.setWithLayers([TeXLayer,TeXBoxVisualizationLayer]);$m.setWithLayers([TeXLayer,TeXToleranceVisualizationLayer]);$m.setWithLayers([TeXLayer,TeXBoxVisualizationLayer,TeXRatioVisualizationLayer,TeXToleranceVisualizationLayer]);$m.getWithLayers();truetruefalse14truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalse
null240