示例#1
0
        public static HorizontalRule Get(float Height, float Width, float Shift)
        {
            var box = ObjPool <HorizontalRule> .Get();

            box.width  = Width;
            box.height = Height;
            box.shift  = Shift;
            return(box);
        }
示例#2
0
 public override void Flush()
 {
     if (BaseAtom != null)
     {
         BaseAtom.Flush();
         BaseAtom = null;
     }
     ObjPool <AttrStyleAtom> .Release(this);
 }
示例#3
0
        public static AttrStyleAtom Get(Atom baseAtom, string styleStr)
        {
            var atom = ObjPool <AttrStyleAtom> .Get();

            atom.BaseAtom = baseAtom;
            atom.Style    = ParseFontStyle(styleStr);
            atom.Type     = baseAtom.Type;
            return(atom);
        }
示例#4
0
文件: RowAtom.cs 项目: step4/rac-quiz
 public override void Flush()
 {
     for (int i = 0; i < Elements.Count; i++)
     {
         Elements[i].Flush();
     }
     Elements.Clear();
     ObjPool <RowAtom> .Release(this);
 }
示例#5
0
        public static AttrBgAtom Get(Atom baseAtom, string color, bool margin)
        {
            var atom = ObjPool <AttrBgAtom> .Get();

            atom.baseAtom = baseAtom;
            atom.margin   = margin;
            atom.color    = color == null ? Color.clear : AttrColorAtom.ParseColor(color);
            return(atom);
        }
示例#6
0
 public override void Flush()
 {
     if (baseBox != null)
     {
         baseBox.Flush();
         baseBox = null;
     }
     ObjPool <AttrLinkBox> .Release(this);
 }
示例#7
0
        public static AttrTransformationBox Get(AttrTransformationAtom atom, AttrTransformationBox endBox)
        {
            var box = ObjPool <AttrTransformationBox> .Get();

            box.pivotMode    = atom.pivotMode;
            box.endBox       = endBox;
            box.attachedAtom = atom;
            return(box);
        }
示例#8
0
        public static AttrColorBox Get(int mixMode, Color color, AttrColorBox endBox)
        {
            var box = ObjPool <AttrColorBox> .Get();

            box.renderColor = color;
            box.mixMode     = mixMode;
            box.endBox      = endBox;
            return(box);
        }
示例#9
0
        public static Radical Get(Atom baseAtom, Atom degreeAtom)
        {
            var atom = ObjPool <Radical> .Get();

            atom.Type       = CharTypeInternal.Inner;
            atom.BaseAtom   = baseAtom;
            atom.DegreeAtom = degreeAtom;
            return(atom);
        }
示例#10
0
        public static AttrColorBox Get(int mixMode, Color color)
        {
            var box = ObjPool <AttrColorBox> .Get();

            box.color   = color;
            box.mixmode = mixMode;
            // leave the size zero
            return(box);
        }
示例#11
0
        public static StrikeBox Get(float Height, float Width, float Depth)
        {
            var box = ObjPool <StrikeBox> .Get();

            box.width  = Width;
            box.height = Height;
            box.depth  = Depth;
            return(box);
        }
示例#12
0
        /// extract the content and flush this formula
        public Atom ExtractRoot()
        {
            Atom root = RootAtom;

            RootAtom = null;
            ObjPool <TexFormula> .Release(this);

            return(root);
        }
示例#13
0
        public static AttrBorderAtom Get(Atom baseAtom, string param, bool margin)
        {
            var atom = ObjPool <AttrBorderAtom> .Get();

            atom.baseAtom = baseAtom;
            atom.margin   = margin;
            Parse(param, out atom.thickness, out atom.radius, out atom.color);
            return(atom);
        }
 public override void Flush()
 {
     base.Flush();
     endBox   = null;
     endLimit = 0;
     attachedAtom.generatedBox = null;
     attachedAtom = null;
     ObjPool <AttrTransformationBox> .Release(this);
 }
示例#15
0
        public static ScriptsAtom Get(Atom baseAtom, Atom subscriptAtom, Atom superscriptAtom)
        {
            var atom = ObjPool <ScriptsAtom> .Get();

            atom.BaseAtom        = baseAtom;
            atom.SubscriptAtom   = subscriptAtom;
            atom.SuperscriptAtom = superscriptAtom;
            atom.Type            = CharTypeInternal.Inner;
            return(atom);
        }
示例#16
0
        public static MatrixAtom Get()
        {
            var atom = ObjPool <MatrixAtom> .Get();

            atom.horizontalAlign = 1 + 8 + 64;
            atom.verticalAlign   = 1 + 8 + 64;
            atom.horizontalLine  = 0;
            atom.verticalLine    = 0;
            return(atom);
        }
示例#17
0
        public static HorizontalBox Get()
        {
            var Box = ObjPool <HorizontalBox> .Get();

            if (Box.children == null)
            {
                Box.children = new List <Box>(8);
            }
            return(Box);
        }
示例#18
0
        public static HolderAtom Get(Atom baseAtom, Vector2 size, TexAlignment Alignment)
        {
            var atom = ObjPool <HolderAtom> .Get();

            atom.BaseAtom = baseAtom;
            atom.size     = size;
            atom.align    = Alignment;
            atom.Type     = CharTypeInternal.Inner;
            return(atom);
        }
示例#19
0
        public static AttrColorBox Get(AttrColorAtom atom, AttrColorBox endBox)
        {
            var box = ObjPool <AttrColorBox> .Get();

            box.renderColor  = atom.color;
            box.mixMode      = atom.mix;
            box.endBox       = endBox;
            box.attachedAtom = atom;
            return(box);
        }
示例#20
0
        public static VerticalBox Get()
        {
            var box = ObjPool <VerticalBox> .Get();

            if (box.children == null)
            {
                box.children = new List <Box>();
            }
            return(box);
        }
示例#21
0
 public override void Flush()
 {
     base.Flush();
     if (character != null)
     {
         character.Flush();
         character = null;
     }
     ObjPool <RotatedCharBox> .Release(this);
 }
示例#22
0
        public static AttrLinkBox Get(Box BaseBox, string MetaKey)
        {
            var box = ObjPool <AttrLinkBox> .Get();

            box.metaKey = MetaKey;
            box.baseBox = BaseBox;

            box.Set(BaseBox.width, BaseBox.height, BaseBox.depth, 0);

            return(box);
        }
示例#23
0
        public static BigOperatorAtom Get(Atom baseAtom, Atom lowerLimitAtom, Atom upperLimitAtom, bool makeSuperScript)
        {
            var atom = ObjPool <BigOperatorAtom> .Get();

            atom.Type             = baseAtom.Type;
            atom.BaseAtom         = baseAtom;
            atom.LowerLimitAtom   = lowerLimitAtom;
            atom.UpperLimitAtom   = upperLimitAtom;
            atom.MakeSuperScripts = makeSuperScript;
            return(atom);
        }
示例#24
0
        public static HorizontalRule Get(float Height, float Width, float Shift, float Depth, bool UseXDepth)
        {
            var box = ObjPool <HorizontalRule> .Get();

            box.width     = Width;
            box.height    = Height;
            box.depth     = Depth;
            box.shift     = Shift;
            box.useXDepth = UseXDepth;
            return(box);
        }
示例#25
0
 public override void Flush()
 {
     base.Flush();
     color = Color.clear;
     if (baseAtom != null)
     {
         baseAtom.Flush();
         baseAtom = null;
     }
     ObjPool <AttrBgAtom> .Release(this);
 }
示例#26
0
        public static HolderAtom Get(Atom baseAtom, float Width, float Height, TexAlignment Alignment)
        {
            var atom = ObjPool <HolderAtom> .Get();

            atom.BaseAtom = baseAtom;
            atom.size     = new Vector2(Width, Height);
            atom.align    = Alignment;

            atom.Type = CharTypeInternal.Inner;
            return(atom);
        }
示例#27
0
        public static HorizontalBox Get(Box[] box)
        {
            var Box = ObjPool <HorizontalBox> .Get();

            Box.children.EnsureCapacity(box.Length);
            for (int i = 0; i < box.Length; i++)
            {
                Box.Add(box[i]);
            }
            return(Box);
        }
示例#28
0
        public static AccentedAtom Get(Atom baseAtom, string accentName)
        {
            var atom = ObjPool <AccentedAtom> .Get();

            atom.BaseAtom = baseAtom;
            if (atom.BaseAtom == null)
            {
                atom.BaseAtom = SpaceAtom.Get(0, 0, 0);
            }
            atom.AccentAtom = SymbolAtom.GetAtom(accentName);
            return(atom);
        }
示例#29
0
 public override void Flush()
 {
     base.Flush();
     endBox      = null;
     renderColor = Color.clear;
     if (attachedAtom != null)
     {
         attachedAtom.generatedBox = null;
         attachedAtom = null;
     }
     ObjPool <AttrColorBox> .Release(this);
 }
示例#30
0
 public override void Flush()
 {
     if (Elements != null)
     {
         for (int i = 0; i < Elements.Count; i++)
         {
             ListPool <Atom> .Release(Elements[i]);
         }
         Elements.Clear();
     }
     ObjPool <MatrixAtom> .Release(this);
 }