LayoutStrategy
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:21
Exposes a main public method calcLayoutResult that is used by the LayoutManager
to perform layout.
Returning undefined
signals the LayoutManager
to skip the layout.
In charge of calculating the bounding box of the passed objects.
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LayoutStrategy():
LayoutStrategy
Returns
Section titled “Returns”LayoutStrategy
Properties
Section titled “Properties”
static
type:string
='strategy'
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:25
override by subclass for persistence (TS does not support static abstract
)
Methods
Section titled “Methods”calcBoundingBox()
Section titled “calcBoundingBox()”calcBoundingBox(
objects
,context
):undefined
|LayoutStrategyResult
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68
Override this method to customize layout.
Parameters
Section titled “Parameters”objects
Section titled “objects”FabricObject
<Partial
<FabricObjectProps
>, SerializedObjectProps
, ObjectEvents
>[]
context
Section titled “context”Returns
Section titled “Returns”undefined
| LayoutStrategyResult
calcLayoutResult()
Section titled “calcLayoutResult()”calcLayoutResult(
context
,objects
):undefined
|LayoutStrategyResult
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:33
Used by the LayoutManager
to perform layout
@TODO/fix: if this method is calcResult, should calc unconditionally.
the condition to not calc should be evaluated by the layoutManager.
Parameters
Section titled “Parameters”context
Section titled “context”objects
Section titled “objects”FabricObject
<Partial
<FabricObjectProps
>, SerializedObjectProps
, ObjectEvents
>[]
Returns
Section titled “Returns”undefined
| LayoutStrategyResult
layout result OR undefined
to skip layout
getInitialSize()
Section titled “getInitialSize()”getInitialSize(
context
,result
):Point
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58
Parameters
Section titled “Parameters”context
Section titled “context”StrictLayoutContext
& CommonLayoutContext
& object
result
Section titled “result”Pick
<LayoutStrategyResult
, "center"
| "size"
>
Returns
Section titled “Returns”shouldLayoutClipPath()
Section titled “shouldLayoutClipPath()”shouldLayoutClipPath(
__namedParameters
):undefined
|boolean
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:50
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”Returns
Section titled “Returns”undefined
| boolean
shouldPerformLayout()
Section titled “shouldPerformLayout()”shouldPerformLayout(
__namedParameters
):boolean
Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:42
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”Returns
Section titled “Returns”boolean