DVUI

clip

Intersect the given physical rect with the current clipping rect and set as the new clipping rect.

Returns the previous clipping rect, use clipSet to restore it.

Only valid between Window.beginand Window.end.

Parameters

#
new:Rect.Physical
Rect.Physical

Source

Implementation

#
pub fn clip(new: Rect.Physical) Rect.Physical {
    const cw = currentWindow();
    const ret = cw.clipRect;
    clipSet(cw.clipRect.intersect(new));
    return ret;
}