Struct LineScrollTextBuffer.LogicalLine
Represents a single logical line of text with a cached visual wrap count.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
public readonly struct LineScrollTextBuffer.LogicalLine
Remarks
The struct is immutable. To update the cached wrap count, use WithWrapCache(int, float) which returns a new instance with the updated values while preserving the original text content.
Constructors
LogicalLine(string)
Creates a new logical line.
Declaration
public LogicalLine(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text content. |
LogicalLine(string, int, float)
Creates a new logical line with cached wrap information.
Declaration
public LogicalLine(string text, int wrapCount, float displayWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text content. |
| int | wrapCount | The cached wrap count. |
| float | displayWidth | The display width used for calculation. |
Fields
CachedDisplayWidth
The display width that was used when calculating CachedWrapCount. Used for cache invalidation.
Declaration
public readonly float CachedDisplayWidth
Field Value
| Type | Description |
|---|---|
| float |
CachedWrapCount
Cached number of visual lines this logical line wraps to. -1 indicates the wrap count needs to be recalculated.
Declaration
public readonly int CachedWrapCount
Field Value
| Type | Description |
|---|---|
| int |
Text
The text content of this line.
Declaration
public readonly string Text
Field Value
| Type | Description |
|---|---|
| string |
Methods
IsWrapCacheValid(float)
Checks if the wrap cache is valid for the given display width.
Declaration
public bool IsWrapCacheValid(float displayWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| float | displayWidth | The current display width. |
Returns
| Type | Description |
|---|---|
| bool | True if the cache is valid. |
WithWrapCache(int, float)
Returns a new LogicalLine with updated wrap cache.
Declaration
public LineScrollTextBuffer.LogicalLine WithWrapCache(int wrapCount, float displayWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| int | wrapCount | The new wrap count. |
| float | displayWidth | The display width used for calculation. |
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer.LogicalLine | A new LogicalLine with updated cache. |