Package: cairo

Function cairo-surface-set-device-offset

Lambda List

cairo-surface-set-device-offset (surface x-offset y-offset)

Arguments

surface -- a cairo-surface-t instance
x-offset -- a double float offset in the x direction, in device units
y-offset -- a double float offset in the y direction, in device units

Details

Sets an offset that is added to the device coordinates determined by the CTM when drawing to surface. One use case for this function is when we want to create a cairo-surface-t instance that redirects drawing for a portion of an onscreen surface to an offscreen surface in a way that is completely invisible to the user of the Cairo API. Setting a transformation via the function cairo-translate is not sufficient to do this, since functions like the function cairo-device-to-user will expose the hidden offset.

Note that the offset affects drawing to the surface as well as using the surface in a source pattern.
 

See also

2020-12-16