SnapManager
Table of contents
Public class
Signature
class SnapManager {}
Source
packages/editor/src/lib/editor/managers/SnapManager.ts
Constructor
Public constructor
Constructs a new instance of the SnapManager
class
Parameters
Name | Description |
---|---|
|
|
References
Properties
editor
Public readonly property
Signature
readonly editor: Editor
References
Methods
clear()
Public method
Signature
clear(): void
getCurrentCommonAncestor()
Public method
Signature
getCurrentCommonAncestor(): TLShapeId | undefined
References
getLines()
Public method
Signature
getLines(): SnapLine[]
References
getOutlinesInPageSpace()
Public method
Signature
getOutlinesInPageSpace(): Vec[][]
References
getSnappablePoints()
Public method
Signature
getSnappablePoints(): SnapPoint[]
References
getSnappableShapes()
Public method
Signature
getSnappableShapes(): GapNode[]
getSnappingHandleDelta()
Public method
Signature
getSnappingHandleDelta({
handlePoint,
additionalSegments,
}: {
handlePoint: Vec
additionalSegments: Vec[][]
}): null | Vec
Parameters
Name | Description |
---|---|
|
|
Returns
null | Vec
References
getSnapPointsCache()
Public method
Signature
getSnapPointsCache(): import('@tldraw/store').ComputedCache<
SnapPoint[],
TLShape
>
References
ComputedCache, SnapPoint, TLShape
getSnapThreshold()
Public method
Signature
getSnapThreshold(): number
getVisibleGaps()
Public method
Signature
getVisibleGaps(): {
horizontal: Gap[]
vertical: Gap[]
}
setLines()
Public method
Signature
setLines(lines: SnapLine[]): void
Parameters
Name | Description |
---|---|
|
|
Returns
void
References
snapResize()
Public method
Signature
snapResize({
initialSelectionPageBounds,
dragDelta,
handle: originalHandle,
isAspectRatioLocked,
isResizingFromCenter,
}: {
initialSelectionPageBounds: Box
dragDelta: Vec
handle: SelectionCorner | SelectionEdge
isAspectRatioLocked: boolean
isResizingFromCenter: boolean
}): SnapData
Parameters
Name | Description |
---|---|
|
|
Returns
SnapData
References
Box, Vec, SelectionCorner, SelectionEdge
snapTranslate()
Public method
Signature
snapTranslate({
lockedAxis,
initialSelectionPageBounds,
initialSelectionSnapPoints,
dragDelta,
}: {
lockedAxis: 'x' | 'y' | null
initialSelectionSnapPoints: SnapPoint[]
initialSelectionPageBounds: Box
dragDelta: Vec
}): SnapData
Parameters
Name | Description |
---|---|
|
|
Returns
SnapData
References