From f30690b6b3a97ec7c99ba699fa8dd15582d509f3 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sat, 5 May 2018 18:16:30 +0700 Subject: [PATCH] Simplify code a bit (#129) --- src/WpfMath/ScriptsAtom.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WpfMath/ScriptsAtom.cs b/src/WpfMath/ScriptsAtom.cs index 80ecbb2b..4b9655b9 100644 --- a/src/WpfMath/ScriptsAtom.cs +++ b/src/WpfMath/ScriptsAtom.cs @@ -80,10 +80,10 @@ protected override Box CreateBoxCore(TexEnvironment environment) shiftUp = resultBox.Height - texFont.GetSupDrop(superscriptStyle.Style); shiftDown = resultBox.Depth + texFont.GetSubDrop(subscriptStyle.Style); } - else if (this.BaseAtom is CharSymbol) + else if (this.BaseAtom is CharSymbol charSymbol) { - var charFont = ((CharSymbol)this.BaseAtom).GetCharFont(texFont).Value; - if (!((CharSymbol)this.BaseAtom).IsTextSymbol || !texFont.HasSpace(charFont.FontId)) + var charFont = charSymbol.GetCharFont(texFont).Value; + if (!charSymbol.IsTextSymbol || !texFont.HasSpace(charFont.FontId)) delta = texFont.GetCharInfo(charFont, style).Value.Metrics.Italic; if (delta > TexUtilities.FloatPrecision && SubscriptAtom == null) {