Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / COLLECTIONS AND INTERACTION
ScrollView
A clipped view of a caller-owned cell buffer, with independent horizontal and vertical offsets.
The content buffer can be cached between draws. This widget copies only visible cells; it does not allocate a second content-sized buffer. Wide glyphs cut by either edge are omitted.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Members on this page
Feature guides and release status
ScrollView
struct ScrollViewConforms to: Widget.
A clipped view of a caller-owned cell buffer, with independent horizontal and vertical offsets.
The content buffer can be cached between draws. This widget copies only visible cells; it does not allocate a second content-sized buffer. Wide glyphs cut by either edge are omitted.
Source · ScrollView.swift:5content
var content: BufferA public field of this type. Its value type and mutability are shown in the declaration.
Source · ScrollView.swift:6horizontalOffset
var horizontalOffset: IntA public field of this type. Its value type and mutability are shown in the declaration.
Source · ScrollView.swift:7verticalOffset
var verticalOffset: IntA public field of this type. Its value type and mutability are shown in the declaration.
Source · ScrollView.swift:8init(_:horizontalOffset:verticalOffset:)
init(_ content: Buffer, horizontalOffset: Int = 0, verticalOffset: Int = 0)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (3)
content- Argument type and any default are shown in the declaration; see the behavior notes above.
horizontalOffset- Argument type and any default are shown in the declaration; see the behavior notes above.
verticalOffset- Argument type and any default are shown in the declaration; see the behavior notes above.
render(in:buffer:)
func render(in area: Rect, buffer: inout Buffer)Paints this widget into the assigned terminal-cell rectangle. Application code owns state, input routing, and terminal lifetime.
Parameters (2)
in- Argument type and any default are shown in the declaration; see the behavior notes above.
buffer- Mutable destination cell grid.
contentPoint(at:in:)
func contentPoint(at point: Point, in area: Rect) -> Point?Translates a viewport hit to content coordinates, excluding blank padding.
Parameters (2)
at- Argument type and any default are shown in the declaration; see the behavior notes above.
in- Argument type and any default are shown in the declaration; see the behavior notes above.
Returns Point?.