Struct VisualLine
Represents a single visual line of text within a scrolling text buffer. A visual line is one rendered row on screen - either an entire logical line (when no wrapping occurs) or a word-wrapped segment of a longer logical line.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
public readonly struct VisualLine
Remarks
When the TMP measurement path is active, each visual line holds the exact text segment computed by TMP's word-break algorithm, so the segment boundaries always fall on valid word or character breaks.
In the estimation fallback path, segments are raw character substrings split at a fixed character count. This may occasionally split mid-rich-text-tag, producing a segment with unclosed markup. The fallback is only used when no TMP measurement component is available.
Constructors
VisualLine(string, int, int, bool, bool)
Creates a new visual line.
Declaration
public VisualLine(string text, int logicalLineIndex, int visualLineIndex, bool isFirstSegment, bool isLastSegment)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text content of this visual segment. |
| int | logicalLineIndex | The index of the logical line in the buffer that this segment belongs to. |
| int | visualLineIndex | The zero-based index of this segment within its logical line. |
| bool | isFirstSegment |
|
| bool | isLastSegment |
|
Fields
IsFirstSegment
Whether this is the first visual line (segment) of its logical line.
When a logical line produces exactly one visual line (no wrapping),
both IsFirstSegment and IsLastSegment are true.
Declaration
public readonly bool IsFirstSegment
Field Value
| Type | Description |
|---|---|
| bool |
IsLastSegment
Whether this is the last visual line (segment) of its logical line.
When a logical line produces exactly one visual line (no wrapping),
both IsFirstSegment and IsLastSegment are true.
Declaration
public readonly bool IsLastSegment
Field Value
| Type | Description |
|---|---|
| bool |
LogicalLineIndex
The index of the logical line this visual line belongs to.
Declaration
public readonly int LogicalLineIndex
Field Value
| Type | Description |
|---|---|
| int |
Text
The text content of this visual line segment. When the logical line does not wrap, this holds the full logical line text. When the logical line wraps, this holds only the portion that fits on this row.
Declaration
public readonly string Text
Field Value
| Type | Description |
|---|---|
| string |
VisualLineIndex
The index of this visual line within its logical line (0 = first segment).
Declaration
public readonly int VisualLineIndex
Field Value
| Type | Description |
|---|---|
| int |
Methods
ToString()
Returns the text content of this visual line.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The text content. |