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);Parameters
Section titled “Parameters”| Type | Description |
|---|---|
FiniteShell *shell | The active FiniteShell containing the window. |
double x | The horizontal offset to reverse. |
double y | The vertical offset to reverse. |
Code Example
Section titled “Code Example”#include <finite/draw.h>
// Apply a translationcairo_translate(shell->cr, 64.0, 32.0);
// Undo the translationfinite_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.
Standard Usage
Section titled “Standard Usage”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.