Skip to contents

Set the active hand

Usage

set_hand(hand = NULL, type = c("both", "stroke", "fill"))

Arguments

hand

Hand-drawn geometry created with hand(), or NULL to disable it for the selected type. This disables rough path perturbation only; it does not disable the active brush, and note that some brushes have their own internal wobbly pathing! Use set_brush() as well if you want fully plain, solid rendering.

type

Which rendering channel to update: "both", "stroke", or "fill".

Value

NULL, invisibly. If the active graphics device is not mypaint_device(), this emits a warning and has no effect.

Examples

ex_file <- tempfile(fileext = ".png")
mypaint_device(ex_file)

plot.new()
plot.window(c(0, 10), c(0, 10))
set_hand(hand())
rect(1, 1, 5, 5, col = "darkred", density = 5)
set_hand(human_hand())
rect(5, 5, 9, 9, col = "darkgreen", density = 5)

dev.off()
#> agg_record_1d95656d3599 
#>                       2 
img <- png::readPNG(ex_file)
grid::grid.raster(img)