Skip to content

finite_draw_reset_offset

The finite_draw_reset_offset function attempts to undo a previously applied Cairo translation on the active drawing context.

void finite_draw_reset_offset(FiniteShell *shell, double x, double y);
TypeDescription
FiniteShell *shellThe active FiniteShell containing the window.
double xThe horizontal offset to reverse.
double yThe vertical offset to reverse.
#include <finite/draw.h>
// Apply a translation
cairo_translate(shell->cr, 64.0, 32.0);
// Undo the translation
finite_draw_reset_offset(shell, 64.0, 32.0);

This function applies a cairo_translate(cr, -x, -y) to the active Cairo context.

This function does not reset the Cairo transformation matrix and only reverses a translation operation.

This function must be provided a valid FiniteShell.

This function requires a valid Cairo context in FiniteShell.cr.

This function should only be used to reverse a translation when the original offset values are known.