Fix bug wrapping wide utf16 characters; add documentation for function (#6194)

This commit is contained in:
eoineoineoin
2025-09-17 12:31:07 +01:00
committed by GitHub
parent 9fac1e78fb
commit 94fe0b7721

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics.Contracts;
using System.Text;
using Robust.Client.Graphics;
@@ -36,10 +36,18 @@ internal struct WordWrap
LastRune = new Rune('A');
}
/// <summary>
/// Add <paramref name="rune" /> as the next glyph in the sequence and update internal line break state.
/// </summary>
/// <param name="breakLine">If non-null, indicates that a line break needs to be added at this rune
/// index within the string. This index will refer to the offset of a previously-entered rune</param>
/// <param name="breakNewLine">If non-null, indicates the rune index of an entered newline</param>
/// <param name="skip">If true, indicates that the rune should occupy zero space. Currently only used
/// for newlines.</param>
public void NextRune(Rune rune, out int? breakLine, out int? breakNewLine, out bool skip)
{
BreakIndexCounter = NextBreakIndexCounter;
NextBreakIndexCounter += rune.Utf16SequenceLength;
NextBreakIndexCounter += 1;
breakLine = null;
breakNewLine = null;