update_brush_size: Update the brush size in the mouse move event

Description Usage Arguments Details Value Author(s) Examples

View source: R/brush.R

Description

The brush size is changed by the differences in two successive mouse positions.

Usage

1
update_brush_size(meta, event)

Arguments

meta

the meta data containing the brush information (meta$pos, meta$brush.size, meta$brush.move and meta$start)

event

the event in the callback (if missing, it will search in the parent environment sys.frame(1) which is often the callback function)

Details

The current mouse position is obtained from event$pos(). If the brush is in the move mode (meta$brush.move == TRUE; often set in a mouse click event), the brush size is updated by the differences between meta$start and meta$pos; the former is the starting position of the mouse, and the latter is the current position.

Value

a matrix of the coordinates of the brush rectangle, which can be passed to qrect and used to query the brushed elements by layer$locate(); as a side effect, the brush size is updated, unless it is only a single click or the brush is not in the move mode

Author(s)

Yihui Xie <http://yihui.name>

Examples

1
## see source code of qparallel()

ggobi/cranvas documentation built on May 17, 2019, 3:10 a.m.