@mocanvas/mocanvas · class
declare class LineShapeUtil extends ShapeUtil<LineShape, LineShapeUtilDisplayValues>This one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.
Methods · 12
component(_shape: LineShape): ReactNodegetDefaultProps(): LineShapePropsgetEngineGeometry(shape: LineShape): EngineGeometryA line is its points: the engine fits the spline. w/h are the point
extents; a cubic spline through them stays within its control hull, and
this util has neither an overlay nor a label, so those words feed a
fallback the engine never reaches.
getGeometry(shape: LineShape): Geometry2dgetHandles(shape: LineShape): ShapeHandle[]getIndicatorPath(shape: LineShape): Path2DgetRenderStyle(shape: LineShape): StyleWordshideResizeHandles(_shape: LineShape): booleanhideRotateHandle(_shape: LineShape): booleanhideSelectionBoundsBg(_shape: LineShape): booleanA selected line shows its own outline and its points, and nothing else — the same selection an arrow gets, and for the same reason: a line *is* its points, so a box around them is chrome with nothing to do. Turning it means moving the points, and resizing it means moving the points, so neither the rotate handle nor the resize handles have any work either.
All four answers matter together. selectionHandles only drops the frame
when resize *and* rotate are both hidden, and hideSelectionBoundsFg must
stay false or the shape loses its own outline as well and a selected line
shows nothing at all.
hideSelectionBoundsFg(_shape: LineShape): booleanonHandleDrag(shape: LineShape, info: {Properties · 5
static migrations: _mocanvas_editor.PropsMigrationsstatic options: LineShapeOptionsreadonly options: LineShapeOptionsstatic props: _mocanvas_editor.RecordProps<LineShape>static type: "line"mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.