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)); } } }
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)); } } }