PtClipAdd()

Add a clipping rectangle to the stack

Synopsis:

int PtClipAdd( PtWidget_t *widget, 
               PhRect_t *rect );

Arguments:

widget
A pointer to the widget being clipped.
rect
A pointer to a PhRect_t structure (see the Photon Library Reference) that specifies the clipping to be added.

Description:

This function adds a clipping rectangle to the clipping stack. The rectangle added to the clipping stack is the intersection of the last rectangle on the stack and the provided rectangle rect.

Prior to entering a widget's Draw method, the canvas rectangle derived from the PtBasic-class level is pushed onto the clipping stack. This prevents any children from drawing beyond the canvas of the parent container.

A widget can, however, draw beyond its own canvas or extent unless additional clipping is performed. PtAttemptResize() and PtResizeCanvas() set the Pt_UCLIP bit of a widget's resize flags if the widget requires additional clipping (to prevent it from drawing beyond its own canvas).

Returns:

The current level of stack clipping.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtAttemptResize(), PtClipRemove(), PtResizeCanvas()

PhRect_t, PtCalcCanvas() in the Photon Library Reference