Skip to content

ClipPathLayout

Layout will adjust the bounding box to match the clip path bounding box.

Extends

Constructors

new ClipPathLayout()

new ClipPathLayout(): ClipPathLayout

Returns

ClipPathLayout

Inherited from

LayoutStrategy.constructor

Properties

type

readonly static type: "clip-path" = 'clip-path'

override by subclass for persistence (TS does not support static abstract)

Overrides

LayoutStrategy.type

Defined in

src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:14

Methods

calcBoundingBox()

calcBoundingBox(objects, context): undefined | LayoutStrategyResult

Override this method to customize layout.

Parameters

objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

context: StrictLayoutContext

Returns

undefined | LayoutStrategyResult

Inherited from

LayoutStrategy.calcBoundingBox

Defined in

src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68


calcLayoutResult()

calcLayoutResult(context, objects): undefined | LayoutStrategyResult

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

context: StrictLayoutContext

objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Returns

undefined | LayoutStrategyResult

layout result OR undefined to skip layout

Overrides

LayoutStrategy.calcLayoutResult

Defined in

src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:24


getInitialSize()

getInitialSize(context, result): Point

Parameters

context: StrictLayoutContext & CommonLayoutContext & object

result: Pick<LayoutStrategyResult, "center" | "size">

Returns

Point

Inherited from

LayoutStrategy.getInitialSize

Defined in

src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58


shouldLayoutClipPath()

shouldLayoutClipPath(): boolean

Returns

boolean

Overrides

LayoutStrategy.shouldLayoutClipPath

Defined in

src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:20


shouldPerformLayout()

shouldPerformLayout(context): boolean

Parameters

context: StrictLayoutContext

Returns

boolean

Overrides

LayoutStrategy.shouldPerformLayout

Defined in

src/LayoutManager/LayoutStrategies/ClipPathLayout.ts:16