Skip to content

LayoutProviderHelper ​

Namespace: Hex1b.Nodes

Assembly: Hex1b.dll

Provides common clipping logic for layout providers. Handles intersection with parent layout providers automatically.

csharp
public static class LayoutProviderHelper

Inheritance ​

Object → LayoutProviderHelper

Methods ​

ClipString(ILayoutProvider, int, int, string) ​

Clips a string to the effective clip rect (intersection of this provider and parent).

Parameters:

Returns: ValueTuple<Int32, String>

csharp
public static (int adjustedX, string clippedText) ClipString(ILayoutProvider provider, int x, int y, string text)

GetEffectiveClipRect(ILayoutProvider) ​

Computes the effective clip rect by intersecting this provider's clip rect with its parent's clip rect (if any).

Parameters:

Returns: Rect

csharp
public static Rect GetEffectiveClipRect(ILayoutProvider provider)

ShouldRenderAt(ILayoutProvider, int, int) ​

Determines if a character at the given absolute position should be rendered, considering both this provider's clip rect and any parent's.

Parameters:

Returns: Boolean

csharp
public static bool ShouldRenderAt(ILayoutProvider provider, int x, int y)

Released under the MIT License.