Skip to content

finite_draw_stroke

The finite_draw_stroke function attempts to draw a stroke around the latest rectangle.

void finite_draw_stroke(FiniteShell *shell, FiniteColorGroup *color, cairo_pattern_t *pat, int width)
TypeDescription
FiniteShell *shellThe FiniteShell where the window is.
FiniteColorGroup *colorA single FiniteColorGroup
cairo_pattern_t *patA single Cairo Pattern.
int widthThe thickness of the stroke.
#include <finite/draw.h>
FiniteColorGroup myColor = {
.r = 0,
.g = 0,
.b = 0
};
FiniteColorGroup myStroke = {
.r = 0.9,
.g = 0.9,
.b = 0.9
};
finite_draw_rect(myShell, 0,0, width, height, &myColor, NULL, true); // withPreserve must be true
finite_draw_stroke(myShell, &myStroke, NULL, 5);

This function doesn’t use information from finite_draw_set_draw_position as of v0.6.0

If shell.cr is undefined, this function will not create a new Cairo draw tool and instead will throw an error.

This function must have a valid FiniteShell

This function uses Cairo which requires a valid cairo_surface_t in FiniteShell.cairo_surface beforehand.