natiny_view_set_clip

C
void natiny_view_set_clip(NatinyView view, bool clip);

Cuts off whatever sticks out of the view: its children are drawn only inside its rectangle, and the pointer finds only what is inside it.

Both halves, because they are one thing. A scissor put round the drawing by hand hides a row that has scrolled out of sight and leaves the pointer finding it anyway - the row is still laid out, so it is still hovered and still pressed. Clipping is the layout's answer to overflow, so the view owns it.

Off to begin with: nothing clips unless it is asked to, so a view may draw outside its parent - a menu, a tooltip, a handle on an edge - and still be pressed where it is seen.

Parameters

Name Type Description
view NatinyView View handle
clip bool false lets its children overflow again

Example

C
natiny_view_set_clip(window, true);
natiny_view_set_offset(column, 0.0f, -scroll);