Package: cairo

Function cairo:rectangle

Lambda List

cairo:rectangle (cr x y width height)

Arguments

cr -- a cairo:context-t instance
x -- a number for the x coordinate of the top left corner of the rectangle
y -- a number for the y coordinate to the top left corner of the rectangle
width -- a number for the width of the rectangle
height -- a number for the height of the rectangle

Details

Adds a closed sub-path rectangle of the given size to the current path at position (x,y) in user-space coordinates.

This function is logically equivalent to:
(cairo:move-to cr x y)
(cairo:rel-line-to cr width 0)
(cairo:rel-line-to cr 0 height)
(cairo:rel-line-to cr (- width) 0)
(cairo:close-path cr)  

Notes

The numbers for the arguments are coerced to double floats before being passed to the foreign C function.
 

See also

2025-1-14