Skip to content

Commit

Permalink
Don't add empty runs
Browse files Browse the repository at this point in the history
 - also use new code
  • Loading branch information
mattleibow committed Feb 10, 2019
1 parent 4e69c41 commit eb4885a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ public static IEnumerable<SKTextRun> Create(string text, SKTextRunLookup lookup)
}
}

runs.Add(new SKTextRun(pre));
SKTypeface typeface;
string character;
if (lookup.TryLookup(expression, out typeface, out character))
if (!string.IsNullOrEmpty(pre))
{
runs.Add(new SKTextRun(pre));
}
if (lookup.TryLookup(expression, out var typeface, out var character))
{
runs.Add(new SKTextRun(character) { Typeface = typeface, Color = color });
}
Expand Down

0 comments on commit eb4885a

Please sign in to comment.