Ejemplo n.º 1
0
        public override Box CreateBox(TexStyle style)
        {
            if (BaseAtom == null)
            {
                return(StrutBox.Empty);
            }
            else
            {
                Box box;
                if (UnderLink)
                {
                    var   baseBox = BaseAtom.CreateBox(style);
                    float margin  = TEXConfiguration.main.NegateMargin * TexUtility.SizeFactor(style) / 2;
                    float thick   = TEXConfiguration.main.LineThickness * TexUtility.SizeFactor(style) / 2;

                    box = HorizontalBox.Get(baseBox);
                    box.Add(StrutBox.Get(-box.width, 0, 0, 0));
                    box.Add(StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth,
                                          margin, thick, StrikeBox.StrikeMode.underline, 0, 0));
                    return(AttrLinkBox.Get(box, MetaKey));
                }
                else
                {
                    return(AttrLinkBox.Get(BaseAtom.CreateBox(style), MetaKey));
                }
            }
        }
Ejemplo n.º 2
0
        public override Box CreateBox()
        {
            if (BaseAtom == null)
            {
                return(StrutBox.Empty);
            }
            else
            {
                if (UnderLink)
                {
                    var baseBox = BaseAtom.CreateBox();
                    var box     = HorizontalBox.Get(baseBox);

                    float factor = TexContext.Scale / 2;
                    float thick  = TEXConfiguration.main.LineThickness * factor;

                    box.Add(StrutBox.Get(-box.width, 0, 0, 0));
                    box.Add(StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth,
                                          0, thick, StrikeBox.StrikeMode.underline, 0, 0));

                    return(AttrLinkBox.Get(box, MetaKey, Margin));
                }
                else
                {
                    return(AttrLinkBox.Get(BaseAtom.CreateBox(), MetaKey, Margin));
                }
            }
        }
Ejemplo n.º 3
0
        public override Box CreateBox()
        {
            if (BaseAtom == null)
                return StrutBox.Empty;
            var factor = TexContext.Scale / 2;
            var margin = useMargin ? TEXConfiguration.main.NegateMargin * factor : 0;
            var thick = TEXConfiguration.main.LineThickness * factor;
            var baseBox = BaseAtom.CreateBox();
            var result = HorizontalBox.Get();

            var negateBox = StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth,
                                margin, thick, (StrikeBox.StrikeMode)mode, offsetM, offsetP);
            negateBox.shift = baseBox.shift;
            result.Add(negateBox);
            result.Add(StrutBox.Get(-baseBox.width, 0, 0, 0));
            result.Add(baseBox);
            return result;
        }
Ejemplo n.º 4
0
        public override Box CreateBox(TexStyle style)
        {
            if (BaseAtom == null)
            {
                return(StrutBox.Empty);
            }
            var factor  = TexUtility.SizeFactor(style) / 2;
            var margin  = useMargin ? TEXConfiguration.main.NegateMargin * factor : 0;
            var thick   = TEXConfiguration.main.LineThickness * factor;
            var baseBox = BaseAtom.CreateBox(style);
            var result  = HorizontalBox.Get();

            var negateBox = StrikeBox.Get(baseBox.height, baseBox.width, baseBox.depth,
                                          margin, thick, (StrikeBox.StrikeMode)mode, offsetM, offsetP);

            negateBox.shift = baseBox.shift;
            result.Add(negateBox);
            result.Add(StrutBox.Get(-baseBox.width, 0, 0, 0));
            result.Add(baseBox);
            return(result);
        }