Package: cairo

Function cairo:copy-clip-rectangle-list

Lambda List

cairo:copy-clip-rectangle-list (cr)

Arguments

cr -- a cairo:context-t instance

Return Value

The current clip region as a list of rectangles in user coordinates. Each rectangle is represented by a list with the x, y, width, height values of the rectangle.

Details

Gets the current clip region as a list of rectangles in user coordinates. If the clip region cannot be represented as a list of user-space rectangles the nil value is returned.

Examples

;; Create a recording surface
(cairo:with-recording-surface (surface :color)
  :; Create a context for the recording surface
  (cairo:with-context (context surface)
    ;; Two rectangles
    (cairo:rectangle context 10 10 15 15)
    (cairo:rectangle context 20 20 10 10)
    ;; Clip the context
    (cairo:clip context)
    ;; Get the current clip region
    (cairo:copy-clip-rectangle-list context)))
=> ((10.0d0 10.0d0 15.0d0 10.0d0)
    (10.0d0 20.0d0 20.0d0 5.0d0)
    (20.0d0 25.0d0 10.0d0 5.0d0))    
 

See also

2025-1-2