Class ControlRenderingHelpers
- Namespace
- SharpConsoleUI.Helpers
- Assembly
- SharpConsoleUI.dll
Shared rendering utilities for controls to avoid code duplication. Extracted from 14 controls that had identical margin/padding rendering logic.
public static class ControlRenderingHelpers
- Inheritance
-
ControlRenderingHelpers
- Inherited Members
Methods
FillBottomMargin(CharacterBuffer, LayoutRect, LayoutRect, int, Color, Color)
Fills the bottom margin area of a control with the specified background.
public static void FillBottomMargin(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, int endY, Color foreground, Color background)
Parameters
bufferCharacterBufferThe character buffer to render to.
boundsLayoutRectThe control's bounding rectangle.
clipRectLayoutRectThe clipping rectangle for rendering.
endYintThe Y coordinate where content ends (margin begins).
foregroundColorThe foreground color for the fill character.
backgroundColorThe background color for the fill character.
FillHorizontalMargins(CharacterBuffer, LayoutRect, LayoutRect, int, int, int, Color, Color)
Fills horizontal margins (left and right) for a single line.
public static void FillHorizontalMargins(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, int y, int contentStartX, int contentWidth, Color foreground, Color background)
Parameters
bufferCharacterBufferThe character buffer to render to.
boundsLayoutRectThe control's bounding rectangle.
clipRectLayoutRectThe clipping rectangle for rendering.
yintThe Y coordinate of the line to fill margins for.
contentStartXintThe X coordinate where content starts.
contentWidthintThe width of the content area.
foregroundColorThe foreground color for the fill character.
backgroundColorThe background color for the fill character.
FillTopMargin(CharacterBuffer, LayoutRect, LayoutRect, int, Color, Color)
Fills the top margin area of a control with the specified background.
public static void FillTopMargin(CharacterBuffer buffer, LayoutRect bounds, LayoutRect clipRect, int startY, Color foreground, Color background)
Parameters
bufferCharacterBufferThe character buffer to render to.
boundsLayoutRectThe control's bounding rectangle.
clipRectLayoutRectThe clipping rectangle for rendering.
startYintThe Y coordinate where content starts (margin ends).
foregroundColorThe foreground color for the fill character.
backgroundColorThe background color for the fill character.