struct

TUI::ClipRect

Inherits Struct < Value < Object

A rectangle, in the same 1-based coordinate convention as Widget#x/ #y, that Screen#with_clip bounds #blit writes to. Exists so a container of independently-compositing children (see Grid, src/tui/layout/grid.cr) can bound where its children are allowed to draw without needing to intercept or redirect their #composite calls — every Widget#composite ever reaches the real screen through exactly one call, Screen#blit, so clipping there is sufficient no matter how deep the widget tree gets.

Constructors

new(row : Int32, col : Int32, height : Int32, width : Int32)
Source

Instance methods

clone
Source
col
copy_with(row _row = @row, col _col = @col, height _height = @height, width _width = @width)
Source
height
intersect(other : ClipRect) : ClipRect

Narrows self to the overlap with other — used by #with_clip so a nested clip can only ever shrink the bound in effect, never widen past an outer container's own clip.

Source
row
width