Skip to content

FitContentLayout

Defined in: src/LayoutManager/LayoutStrategies/FitContentLayout.ts:8

Layout will adjust the bounding box to fit target’s objects.

Extends

Constructors

new FitContentLayout()

new FitContentLayout(): FitContentLayout

Returns

FitContentLayout

Inherited from

LayoutStrategy.constructor

Properties

type

readonly static type: "fit-content" = 'fit-content'

Defined in: src/LayoutManager/LayoutStrategies/FitContentLayout.ts:9

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

Overrides

LayoutStrategy.type

Methods

calcBoundingBox()

calcBoundingBox(objects, context): undefined | LayoutStrategyResult

Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:68

Override this method to customize layout.

Parameters

objects

FabricObject[]

context

StrictLayoutContext

Returns

undefined | LayoutStrategyResult

Inherited from

LayoutStrategy.calcBoundingBox


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

context

StrictLayoutContext

objects

FabricObject[]

Returns

undefined | LayoutStrategyResult

layout result OR undefined to skip layout

Inherited from

LayoutStrategy.calcLayoutResult


getInitialSize()

getInitialSize(context, result): Point

Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:58

Parameters

context

StrictLayoutContext & CommonLayoutContext & object

result

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

Returns

Point

Inherited from

LayoutStrategy.getInitialSize


shouldLayoutClipPath()

shouldLayoutClipPath(__namedParameters): undefined | boolean

Defined in: src/LayoutManager/LayoutStrategies/LayoutStrategy.ts:50

Parameters

__namedParameters

StrictLayoutContext

Returns

undefined | boolean

Inherited from

LayoutStrategy.shouldLayoutClipPath


shouldPerformLayout()

shouldPerformLayout(context): boolean

Defined in: src/LayoutManager/LayoutStrategies/FitContentLayout.ts:16

layout on all triggers Override at will

Parameters

context

StrictLayoutContext

Returns

boolean

Overrides

LayoutStrategy.shouldPerformLayout