@fabwcie/free-drawing / utils/selection
utils/selection
Functions
getPlacementArea()
getPlacementArea(
drawer,gap):ViewArea
Defined in: packages/free-drawing/src/utils/selection.ts:81
Part of the view where elements next to the selection are placed: without its edges, the options panel (right) nor the toolbar of the footer
Parameters
drawer
drawer showing them
gap
number
space kept from the edges (px)
Returns
edges of the area in view (px)
getSelectionBox()
getSelectionBox(
drawer):IRect|null
Defined in: packages/free-drawing/src/utils/selection.ts:30
Box of selected shapes in view while elements next to the selection are shown (selection menu, link editor)
Parameters
drawer
drawer whose selection is placed
Returns
IRect | null
client rect around selected shapes (view coordinates), null without selection, in read only, during a pointer action, a drag or a transform, or out of view
getSelectionSurroundings()
getSelectionSurroundings(
drawer):IRect
Defined in: packages/free-drawing/src/utils/selection.ts:61
Box of the selection with what is drawn around it, to place elements out of it: transformer (box, resize and rotation anchors wherever rotation puts them) and titles of selected frames (above their box)
Parameters
drawer
drawer with a selection widget and selected shapes
Returns
IRect
client rect in view coordinates
unionRect()
unionRect(
boxes):IRect
Defined in: packages/free-drawing/src/utils/selection.ts:12
Box around boxes
Parameters
boxes
IRect[]
boxes in the same coordinates, one at least
Returns
IRect
smallest box containing them