Browse Source

[SKIA] Don't crash the entire renderer if one of the text lines have 0 length

pull/2011/head
Nikita Tsukanov 8 years ago
parent
commit
e1f4a243d7
  1. 2
      src/Skia/Avalonia.Skia/FormattedTextImpl.cs

2
src/Skia/Avalonia.Skia/FormattedTextImpl.cs

@ -272,7 +272,7 @@ namespace Avalonia.Skia
}
var textLine = Text.Substring(line.Start, line.Length);
currX -= paint.MeasureText(textLine) * factor;
currX -= textLine.Length == 0 ? 0 : paint.MeasureText(textLine) * factor;
for (int i = line.Start; i < line.Start + line.Length;)
{

Loading…
Cancel
Save