Fix output log text ranges to handle line ending
This commit is contained in:
@@ -541,7 +541,7 @@ namespace FlaxEditor.Windows
|
||||
{
|
||||
ref var line = ref lines[j];
|
||||
textBlock.Range.StartIndex = startIndex + line.FirstCharIndex;
|
||||
textBlock.Range.EndIndex = startIndex + line.LastCharIndex;
|
||||
textBlock.Range.EndIndex = startIndex + line.LastCharIndex + 1;
|
||||
textBlock.Bounds = new Rectangle(new Float2(0.0f, prevBlockBottom), line.Size);
|
||||
|
||||
if (textBlock.Range.Length > 0)
|
||||
@@ -550,7 +550,7 @@ namespace FlaxEditor.Windows
|
||||
var regexStart = line.FirstCharIndex;
|
||||
if (j == 0)
|
||||
regexStart += prefixLength;
|
||||
var regexLength = line.LastCharIndex - regexStart;
|
||||
var regexLength = line.LastCharIndex + 1 - regexStart;
|
||||
if (regexLength > 0)
|
||||
{
|
||||
var match = _compileRegex.Match(entryText, regexStart, regexLength);
|
||||
|
||||
@@ -17,17 +17,17 @@ class FontAsset;
|
||||
/// <summary>
|
||||
/// The text range.
|
||||
/// </summary>
|
||||
API_STRUCT() struct TextRange
|
||||
API_STRUCT(NoDefault) struct TextRange
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(TextRange);
|
||||
|
||||
/// <summary>
|
||||
/// The start index.
|
||||
/// The start index (inclusive).
|
||||
/// </summary>
|
||||
API_FIELD() int32 StartIndex;
|
||||
|
||||
/// <summary>
|
||||
/// The end index.
|
||||
/// The end index (exclusive).
|
||||
/// </summary>
|
||||
API_FIELD() int32 EndIndex;
|
||||
|
||||
@@ -70,7 +70,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(TextRange);
|
||||
/// <summary>
|
||||
/// Gets the substring from the source text.
|
||||
/// </summary>
|
||||
/// <param name="other">The text.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The substring of the original text of the defined range.</returns>
|
||||
StringView Substring(const StringView& text) const
|
||||
{
|
||||
@@ -87,7 +87,7 @@ struct TIsPODType<TextRange>
|
||||
/// <summary>
|
||||
/// The font line info generated during text processing.
|
||||
/// </summary>
|
||||
API_STRUCT() struct FontLineCache
|
||||
API_STRUCT(NoDefault) struct FontLineCache
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(FontLineCache);
|
||||
|
||||
@@ -151,7 +151,7 @@ struct TIsPODType<FontLineCache>
|
||||
/// <summary>
|
||||
/// The cached font character entry (read for rendering and further processing).
|
||||
/// </summary>
|
||||
API_STRUCT() struct FontCharacterEntry
|
||||
API_STRUCT(NoDefault) struct FontCharacterEntry
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(FontCharacterEntry);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user