Skip to content

fabricjs-object-fit / IObjectFit

Interface: IObjectFit

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:4

Extends

  • Group

Properties

__corner?

optional __corner?: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:67

keeps the value of the last hovered corner during mouse move. 0 is no corner, or 'mt', 'ml', 'mtr' etc.. It should be private, but there is no harm in using it as a read-only property. this isn't cleaned automatically. Non selected objects may have wrong values

Inherited from

Group.__corner


_controlsVisibility

_controlsVisibility: Record<string, boolean>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:73

a map of control visibility for this object. this was left when controls were introduced to not break the api too much this takes priority over the generic control visibility

Inherited from

Group._controlsVisibility


_objects

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

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:27

Inherited from

Group._objects


_scaling?

optional _scaling?: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:92

A boolean used from the gesture module to keep tracking of a scaling action when there is no scaling transform in place. This is an edge case and is used twice in all codebase. Probably added to keep track of some performance issues

TODO

use git blame to investigate why it was added DON'T USE IT. WE WILL TRY TO REMOVE IT

Inherited from

Group._scaling


absolutePositioned

absolutePositioned: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:117

Meaningful ONLY when the object is used as clipPath. if true, the clipPath will have its top and left relative to canvas, and will not be influenced by the object transform. This will make the clipPath relative to the canvas, but clipping just a particular object. WARNING this is beta, this feature may change or be renamed. since 2.4.0

Default

ts
false

Inherited from

Group.absolutePositioned


aCoords

aCoords: TCornerPoint

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:26

Describe object's corner position in scene coordinates. The coordinates are derived from the following: left, top, width, height, scaleX, scaleY, skewX, skewY, angle, strokeWidth. The coordinates do not depend on viewport changes. The coordinates get updated with setCoords. You can calculate them without updating with ()

Inherited from

Group.aCoords


angle

angle: TDegree

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:256

Angle of rotation of an object (in degrees)

Default

ts
0

Inherited from

Group.angle


backgroundColor

backgroundColor: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:109

Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/

Inherited from

Group.backgroundColor


borderColor

borderColor: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:40

Color of controlling borders of an object (when it's active)

Default

ts
rgb(178,204,255)

Inherited from

Group.borderColor


borderDashArray

borderDashArray: number[] | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:41

Array specifying dash pattern of an object's borders (hasBorder must be true)

Since

1.6.2

Inherited from

Group.borderDashArray


borderOpacityWhenMoving

borderOpacityWhenMoving: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:42

Opacity of object's controlling borders when object is active and moving

Default

ts
0.4

Inherited from

Group.borderOpacityWhenMoving


borderScaleFactor

borderScaleFactor: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:43

Scale factor for the border of the objects ( selection box and controls stroke ). Bigger number will make a thicker border border default value is 1, so this scale value is equal to a border and control strokeWidth. If you need to divide border from control strokeWidth you will need to write your own render function for controls

Default

ts
1

Inherited from

Group.borderScaleFactor


centeredRotation

centeredRotation: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:118

When true the object will rotate on its center. When false will rotate around the origin point defined by originX and originY. The value of this property is IGNORED during a transform if the canvas has already centeredRotation set to true The object method rotate will always consider this property and never the canvas's one.

Since

1.3.4

Inherited from

Group.centeredRotation


centeredScaling

centeredScaling: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:119

When true, this object will use center point as the origin of transformation when being scaled via the controls.

Since

1.3.4

Inherited from

Group.centeredScaling


clipPath?

optional clipPath?: FabricObject<Partial<ObjectProps>, SerializedObjectProps, ObjectEvents>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:115

Inherited from

Group.clipPath


clipPathId?

optional clipPathId?: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts:9

When an object is being exported as SVG as a clippath, a reference inside the SVG is needed. This reference is a UID in the fabric namespace and is temporary stored here.

Inherited from

Group.clipPathId


controls

controls: TControlSet

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:78

holds the controls for the object. controls are added by default_controls.js

Inherited from

Group.controls


cornerColor

cornerColor: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:35

Color of controlling corners of an object (when it's active)

Default

ts
rgb(178,204,255)

Inherited from

Group.cornerColor


cornerDashArray

cornerDashArray: number[] | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:38

Array specifying dash pattern of an object's control (hasBorder must be true)

Since

1.6.2

Default

ts
null

Inherited from

Group.cornerDashArray


cornerSize

cornerSize: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:32

Size of object's controlling corners (in pixels)

Default

ts
13

Inherited from

Group.cornerSize


cornerStrokeColor

cornerStrokeColor: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:36

Color of controlling corners of an object (when it's active and transparentCorners false)

Since

1.6.2

Default

ts
''

Inherited from

Group.cornerStrokeColor


cornerStyle

cornerStyle: "rect" | "circle"

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:37

Specify style of control, 'rect' or 'circle' This is deprecated. In the future there will be a standard control render And you can swap it with one of the alternative proposed with the control api

Since

1.6.2

Default

ts
'rect'

Deprecated

Inherited from

Group.cornerStyle


dirty

dirty: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:141

When set to true, object's cache will be rerendered next render call. since 1.7.0

Default

ts
true

Inherited from

Group.dirty


enableRecomputeOnScaled

enableRecomputeOnScaled: boolean

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:17


enableRecomputeOnScaling

enableRecomputeOnScaling: boolean

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:19


evented

evented: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:47

When set to false, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4

Inherited from

Group.evented


excludeFromExport

excludeFromExport: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:113

When true, object is not exported in OBJECT/JSON

Since

1.6.3

Inherited from

Group.excludeFromExport


fill

fill: string | TFiller | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:100

Inherited from

Group.fill


fillRule

fillRule: CanvasFillRule

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:101

Fill rule used to fill an object accepted values are nonzero, evenodd <b>Backwards incompatibility note:</b> This property was used for setting globalCompositeOperation until v1.4.12 (use globalCompositeOperation instead)

Default

ts
nonzero

Inherited from

Group.fillRule


flipX

flipX: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:242

When true, an object is rendered as flipped horizontally

Default

ts
false

Inherited from

Group.flipX


flipY

flipY: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:243

When true, an object is rendered as flipped vertically

Default

ts
false

Inherited from

Group.flipY


globalCompositeOperation

globalCompositeOperation: GlobalCompositeOperation

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:108

Composite rule used for canvas globalCompositeOperation

Inherited from

Group.globalCompositeOperation


hasBorders

hasBorders: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:44

When set to false, object's controlling borders are not rendered

Inherited from

Group.hasBorders


hasControls

hasControls: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:39

When set to false, object's controls are not displayed and can not be used to manipulate object

Default

ts
true

Inherited from

Group.hasControls


height

height: number

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:11

Overrides

Group.height


hoverCursor

hoverCursor: string | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:50

Default cursor value used when hovering over this object on canvas

Default

ts
null

Inherited from

Group.hoverCursor


includeDefaultValues

includeDefaultValues: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:112

When false, default object's values are not included in its serialization

Inherited from

Group.includeDefaultValues


interactive

interactive: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:93

Used to allow targeting of object inside groups. set to true if you want to select an object inside a group.
REQUIRES subTargetCheck set to true This will be not removed but slowly replaced with a method setInteractive that will take care of enabling subTargetCheck and necessary object events. There is too much attached to group interactivity to just be evaluated by a boolean in the code

Deprecated

Inherited from

Group.interactive


inverted

inverted: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:116

Meaningful ONLY when the object is used as clipPath. if true, the clipPath will make the object clip to the outside of the clipPath since 2.4.0

Default

ts
false

Inherited from

Group.inverted


isMoving?

optional isMoving?: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:83

internal boolean to signal the code that the object is part of the move action.

Inherited from

Group.isMoving


layoutManager

layoutManager: LayoutManager

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:94

Inherited from

Group.layoutManager


left

left: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:239

Left position of an object. Note that by default it's relative to object left. You can change this by setting originX

Default

ts
0

Inherited from

Group.left


lockMovementX

lockMovementX: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:24

When true, object horizontal movement is locked

Inherited from

Group.lockMovementX


lockMovementY

lockMovementY: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:25

When true, object vertical movement is locked

Inherited from

Group.lockMovementY


lockRotation

lockRotation: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:26

When true, object rotation is locked

Inherited from

Group.lockRotation


lockScalingFlip

lockScalingFlip: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:31

When true, object cannot be flipped by scaling into negative values

Inherited from

Group.lockScalingFlip


lockScalingX

lockScalingX: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:27

When true, object horizontal scaling is locked

Inherited from

Group.lockScalingX


lockScalingY

lockScalingY: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:28

When true, object vertical scaling is locked

Inherited from

Group.lockScalingY


lockSkewingX

lockSkewingX: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:29

When true, object horizontal skewing is locked

Inherited from

Group.lockSkewingX


lockSkewingY

lockSkewingY: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:30

When true, object vertical skewing is locked

Inherited from

Group.lockSkewingY


matrixCache?

optional matrixCache?: TMatrixCache

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:34

storage cache for object full transform matrix

Inherited from

Group.matrixCache


minScaleLimit

minScaleLimit: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:97

Minimum allowed scale value of an object

Default

ts
0

Inherited from

Group.minScaleLimit


mode

mode: IFitMode

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:7


moveCursor

moveCursor: string | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:51

Default cursor value used when moving this object on canvas

Default

ts
null

Inherited from

Group.moveCursor


noScaleCache

noScaleCache: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:21

When true, cache does not get updated during scaling. The picture will get blocky if scaled too much and will be redrawn with correct details at the end of scaling. this setting is performance and application dependant. default to true since 1.7.0

Default

ts
true

Inherited from

Group.noScaleCache


object

object: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents> | null

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:21


objectCaching

objectCaching: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:114

When true, object is cached on an additional canvas. When false, object is not cached unless necessary ( clipPath ) default to true

Since

1.7.0

Default

ts
true

Inherited from

Group.objectCaching


oCoords

oCoords: Record<string, TOCoord>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:58

The object's controls' position in viewport coordinates Calculated by Control#positionHandler and Control#calcCornerCoords, depending on padding. corner/touchCorner describe the 4 points forming the interactive area of the corner. Used to draw and locate controls.

Inherited from

Group.oCoords


opacity

opacity: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:98

Opacity of an object

Default

ts
1

Inherited from

Group.opacity


originX

originX: TOriginX

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:251

Deprecated

please use 'center' as value in new projects

Inherited from

Group.originX


originY

originY: TOriginY

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:255

Deprecated

please use 'center' as value in new projects

Inherited from

Group.originY


ownMatrixCache?

optional ownMatrixCache?: TMatrixCache

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:30

storage cache for object transform matrix

Inherited from

Group.ownMatrixCache


padding

padding: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:17

Padding between object and its controlling borders (in pixels)

Default

ts
0

Inherited from

Group.padding


paintFirst

paintFirst: "fill" | "stroke"

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:99

Determines if the fill or the stroke is drawn first (one of "fill" or "stroke")

Inherited from

Group.paintFirst


parent?

optional parent?: Group

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:638

A reference to the parent of the object Used to keep the original parent ref when the object has been added to an ActiveSelection, hence loosing the group ref

Inherited from

Group.parent


perPixelTargetFind

perPixelTargetFind: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:48

When set to true, objects are "found" on canvas on per-pixel basis rather than according to bounding box

Inherited from

Group.perPixelTargetFind


position

position: Partial<IPosition>

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:13


scaleX

scaleX: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:244

Object scale factor (horizontal)

Default

ts
1

Inherited from

Group.scaleX


scaleY

scaleY: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:245

Object scale factor (vertical)

Default

ts
1

Inherited from

Group.scaleY


selectable

selectable: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:46

When set to false, an object can not be selected for modification (using either point-click-based or group-based selection). But events still fire on it.

Inherited from

Group.selectable


selectionBackgroundColor

selectionBackgroundColor: string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:45

Selection Background color of an object. colored layer behind the object when it is active. does not mix good with globalCompositeOperation methods.

Deprecated

Inherited from

Group.selectionBackgroundColor


shadow

shadow: Shadow | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:110

Inherited from

Group.shadow


skewX

skewX: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:246

Angle of skew on x axes of an object (in degrees)

Default

ts
0

Inherited from

Group.skewX


skewY

skewY: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:247

Angle of skew on y axes of an object (in degrees)

Default

ts
0

Inherited from

Group.skewY


snapAngle?

optional snapAngle?: TDegree

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:22

The angle that an object will lock to while rotating.

Inherited from

Group.snapAngle


snapThreshold?

optional snapThreshold?: TDegree

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:23

The angle difference from the current snapped angle in which snapping should occur. When undefined, the snapThreshold will default to the snapAngle.

Inherited from

Group.snapThreshold


stroke

stroke: string | TFiller | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:102

Inherited from

Group.stroke


strokeDashArray

strokeDashArray: number[] | null

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:103

Array specifying dash pattern of an object's stroke (stroke must be defined)

Default

ts
null;

Inherited from

Group.strokeDashArray


strokeDashOffset

strokeDashOffset: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:104

Line offset of an object's stroke

Default

ts
0

Inherited from

Group.strokeDashOffset


strokeLineCap

strokeLineCap: CanvasLineCap

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:105

Line endings style of an object's stroke (one of "butt", "round", "square")

Default

ts
butt

Inherited from

Group.strokeLineCap


strokeLineJoin

strokeLineJoin: CanvasLineJoin

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:106

Corner style of an object's stroke (one of "bevel", "round", "miter")

Inherited from

Group.strokeLineJoin


strokeMiterLimit

strokeMiterLimit: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:107

Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke

Default

ts
4

Inherited from

Group.strokeMiterLimit


strokeUniform

strokeUniform: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:258

When false, the stoke width will scale with the object. When true, the stroke will always match the exact pixel size entered for stroke width. this Property does not work on Text classes or drawing call that uses strokeText,fillText methods default to false

Since

2.6.0

Default

ts
false

Default

ts
false

Inherited from

Group.strokeUniform


strokeWidth

strokeWidth: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:257

Width of a stroke used to render this object

Default

ts
1

Inherited from

Group.strokeWidth


subTargetCheck

subTargetCheck: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:81

Used to optimize performance set to false if you don't need contained objects to be targets of events

Inherited from

Group.subTargetCheck


top

top: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:238

Top position of an object. Note that by default it's relative to object top. You can change this by setting originY

Default

ts
0

Inherited from

Group.top


touchCornerSize

touchCornerSize: number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:33

Size of object's controlling corners when touch interaction is detected

Default

ts
24

Inherited from

Group.touchCornerSize


transparentCorners

transparentCorners: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:34

When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill)

Default

ts
true

Inherited from

Group.transparentCorners


type

type: string

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:5

Legacy identifier of the class. Prefer using utils like isType or instanceOf Will be removed in fabric 7 or 8. The setter exists to avoid type errors in old code and possibly current deserialization code. DO NOT build new code around this type value

TODO

add sustainable warning message

Deprecated

Overrides

Group.type


useObjectTransform

useObjectTransform: boolean

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:15


visible

visible: boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:111

When set to false, an object is not rendered on canvas

Inherited from

Group.visible


width

width: number

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:9

Overrides

Group.width

Methods

_drawClipPath()

_drawClipPath(ctx, clipPath, context): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:403

Prepare clipPath state and cache and draw it on instance's cache

Parameters

ctx

CanvasRenderingContext2D

clipPath

FabricObject<Partial<ObjectProps>, SerializedObjectProps, ObjectEvents> | undefined

context

DrawContext

Returns

void

Inherited from

Group._drawClipPath


_exitGroup()

protected _exitGroup(object, removeParentTransform?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:220

Executes the inner fabric logic of exiting a group.

  • Stop watching the object
  • Remove the object from the optimization map this._activeObjects
  • unset the group property of the object

Parameters

object

FabricObject

removeParentTransform?

boolean

true if object should exit group without applying group's transform to it

Returns

void

Inherited from

Group._exitGroup


_limitCacheSize()

_limitCacheSize(dims): TSize & object & object

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:259

Limit the cache dimensions so that X * Y do not cross config.perfLimitSizeTotal and each side do not cross fabric.cacheSideLimit those numbers are configurable so that you can get as much detail as you want making bargain with performances. It mutates the input object dims.

Parameters

dims

TSize & object & object

Returns

TSize & object & object

dims

Inherited from

Group._limitCacheSize


_onObjectAdded()

_onObjectAdded(object): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:153

Parameters

object

FabricObject

Returns

void

Inherited from

Group._onObjectAdded


_onStackOrderChanged()

_onStackOrderChanged(): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:166

Returns

void

Inherited from

Group._onStackOrderChanged


_removeCacheCanvas()

_removeCacheCanvas(): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:335

Remove cacheCanvas and its dimensions from the objects

Returns

void

Inherited from

Group._removeCacheCanvas


_renderControls()

_renderControls(ctx, styleOverride?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:197

Renders controls and borders for the object the context here is not transformed

Parameters

ctx

CanvasRenderingContext2D

Context to render on

styleOverride?

TStyleOverride

properties to override the object style

Returns

void

Todo

move to interactivity

Inherited from

Group._renderControls


_setClippingProperties()

_setClippingProperties(ctx): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:431

Parameters

ctx

CanvasRenderingContext2D

Returns

void

Inherited from

Group._setClippingProperties


_setFillStyles()

_setFillStyles(ctx, __namedParameters): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:430

Parameters

ctx

CanvasRenderingContext2D

__namedParameters

Pick<this, "fill">

Returns

void

Inherited from

Group._setFillStyles


_setOptions()

protected _setOptions(options?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/CommonMethods.d.ts:8

Sets object's properties from options, for initialization only

Parameters

options?

any

Options object

Returns

void

Inherited from

Group._setOptions


_setStrokeStyles()

_setStrokeStyles(ctx, decl): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:429

Parameters

ctx

CanvasRenderingContext2D

decl

Pick<this, "stroke" | "strokeWidth" | "strokeLineCap" | "strokeDashOffset" | "strokeLineJoin" | "strokeMiterLimit">

Returns

void

Inherited from

Group._setStrokeStyles


_setupCompositeOperation()

_setupCompositeOperation(ctx): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:603

Sets canvas globalCompositeOperation for specific object custom composition operation for the particular object can be specified using globalCompositeOperation property

Parameters

ctx

CanvasRenderingContext2D

Rendering canvas context

Returns

void

Inherited from

Group._setupCompositeOperation


_toSVG()

_toSVG(reviver?): string[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:280

Returns svg representation of an instance

Parameters

reviver?

TSVGReviver

Method for further parsing of svg representation.

Returns

string[]

svg representation of an instance

Inherited from

Group._toSVG


add()

add(...objects): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:140

Add objects

Parameters

objects

...FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Returns

number

Inherited from

Group.add


addPaintOrder()

addPaintOrder(this): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts:70

Parameters

this

FabricObjectSVGExportMixin & FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

Returns

string

Inherited from

Group.addPaintOrder


animate()

animate<T>(animatable, options?): Record<string, TAnimation<T>>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:626

Animates object's properties

Type Parameters

T

T extends number | number[] | TColorArg

Parameters

animatable

Record<string, T>

map of keys and end values

options?

Partial<AnimationOptions<T>>

Returns

Record<string, TAnimation<T>>

map of animation contexts

As object — multiple properties

object.animate({ left: ..., top: ... }); object.animate({ left: ..., top: ... }, { duration: ... });

See

http://fabric5.fabricjs.com/fabric-intro-part-2#animation

Inherited from

Group.animate


bringObjectForward()

bringObjectForward(object, intersecting?): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:44

Parameters

object

FabricObject

intersecting?

boolean

Returns

boolean

Inherited from

Group.bringObjectForward


bringObjectToFront()

bringObjectToFront(object): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:42

Parameters

object

FabricObject

Returns

boolean

Inherited from

Group.bringObjectToFront


calcACoords()

calcACoords(): TCornerPoint

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:202

Calculates the coordinates of the 4 corner of the bbox, in absolute coordinates. those never change with zoom or viewport changes.

Returns

TCornerPoint

Inherited from

Group.calcACoords


calcOCoords()

calcOCoords(): Record<string, TOCoord>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:145

Calculates the coordinates of the center of each control plus the corners of the control itself This basically just delegates to each control positionHandler WARNING: changing what is passed to positionHandler is a breaking change, since position handler is a public api and should be done just if extremely necessary

Returns

Record<string, TOCoord>

Inherited from

Group.calcOCoords


calcOwnMatrix()

calcOwnMatrix(): TMat2D

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:223

calculate transform matrix that represents the current transformations from the object's properties, this matrix does not include the group transformation

Returns

TMat2D

transform matrix for the object

Inherited from

Group.calcOwnMatrix


calcTransformMatrix()

calcTransformMatrix(skipGroup?): TMat2D

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:217

calculate transform matrix that represents the current transformations from the object's properties.

Parameters

skipGroup?

boolean

return transform matrix for object not counting parent transformations There are some situation in which this is useful to avoid the fake rotation.

Returns

TMat2D

transform matrix for the object

Inherited from

Group.calcTransformMatrix


canDrop()

canDrop(_e): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:298

Override to customize drag and drop behavior

Parameters

_e

DragEvent

Returns

boolean

true if the object currently dragged can be dropped on the target

Inherited from

Group.canDrop


clearContextTop()

clearContextTop(restoreManually?): CanvasRenderingContext2D | undefined

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:258

Clears the canvas.contextTop in a specific area that corresponds to the object's bounding box that is in the canvas.contextContainer. This function is used to clear pieces of contextTop where we render ephemeral effects on top of the object. Example: blinking cursor text selection, drag effects.

Parameters

restoreManually?

boolean

When true won't restore the context after clear, in order to draw something else.

Returns

CanvasRenderingContext2D | undefined

canvas.contextTop that is either still transformed with the object transformMatrix, or restored to neutral transform

Todo

discuss swapping restoreManually with a renderCallback, but think of async issues

Inherited from

Group.clearContextTop


clone()

clone(propertiesToInclude?): Promise<IObjectFit>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:507

Clones an instance.

Parameters

propertiesToInclude?

string[]

Any properties that you might want to additionally include in the output

Returns

Promise<IObjectFit>

Inherited from

Group.clone


cloneAsImage()

cloneAsImage(options?): FabricImage

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:527

Creates an instance of Image out of an object makes use of toCanvasElement. Once this method was based on toDataUrl and loadImage, so it also had a quality and format option. toCanvasElement is faster and produce no loss of quality. If you need to get a real Jpeg or Png from an object, using toDataURL is the right way to do it. toCanvasElement and then toBlob from the obtained canvas is also a good option.

Parameters

options?

ObjectToCanvasElementOptions

for clone as image, passed to toDataURL

Returns

FabricImage

Object cloned as image.

Todo

fix the export type, it could not be Image but the type that getClass return for 'image'.

Inherited from

Group.cloneAsImage


collectObjects()

collectObjects(__namedParameters, __namedParameters?): InteractiveFabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:48

Parameters

__namedParameters

TBBox

__namedParameters?
includeIntersecting?

boolean

Returns

InteractiveFabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Inherited from

Group.collectObjects


complexity()

complexity(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:40

Returns

number

Inherited from

Group.complexity


contains()

contains(object, deep?): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:39

Parameters

object

FabricObject

deep?

boolean

Returns

boolean

Inherited from

Group.contains


containsPoint()

containsPoint(point): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:138

Checks if point is inside the object

Parameters

point

Point

Point to check against

Returns

boolean

true if point is inside the object

Inherited from

Group.containsPoint


detachObject()

detachObject(restorePreviousObjectTransform?): FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents> | null

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:29

Parameters

restorePreviousObjectTransform?

boolean

Returns

FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents> | null


dispose()

dispose(): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:270

cancel instance's running animations override if necessary to dispose artifacts such as clipPath

Returns

void

Inherited from

Group.dispose


drawBorders()

drawBorders(ctx, options, styleOverride?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:206

Draws borders of an object's bounding box. Requires public properties: width, height Requires public options: padding, borderColor

Parameters

ctx

CanvasRenderingContext2D

Context to draw on

options

TQrDecomposeOut

object representing current object parameters

styleOverride?

TStyleOverride

object to override the object style

Returns

void

Inherited from

Group.drawBorders


drawCacheOnCanvas()

drawCacheOnCanvas(this, ctx): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:408

Paint the cached copy of the object on the target context.

Parameters

this

TCachedFabricObject

ctx

CanvasRenderingContext2D

Context to render on

Returns

void

Inherited from

Group.drawCacheOnCanvas


drawClipPathOnCache()

drawClipPathOnCache(ctx, clipPath, canvasWithClipPath): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:389

Execute the drawing operation for an object clipPath

Parameters

ctx

CanvasRenderingContext2D

Context to render on

clipPath

FabricObject

canvasWithClipPath

HTMLCanvasElement

Returns

void

Inherited from

Group.drawClipPathOnCache


drawControls()

drawControls(ctx, styleOverride?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:225

Draws corners of an object's bounding box. Requires public properties: width, height Requires public options: cornerSize, padding Be aware that since fabric 6.0 this function does not call setCoords anymore. setCoords needs to be called manually if the object of which we are rendering controls is outside the standard selection and transform process.

Parameters

ctx

CanvasRenderingContext2D

Context to draw on

styleOverride?

Partial<Pick<InteractiveFabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>, "cornerSize" | "transparentCorners" | "cornerColor" | "cornerStrokeColor" | "cornerStyle" | "cornerDashArray">>

object to override the object style

Returns

void

Inherited from

Group.drawControls


drawControlsConnectingLines()

drawControlsConnectingLines(ctx, size): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:214

Draws lines from a borders of an object's bounding box to controls that have withConnection property set. Requires public properties: width, height Requires public options: padding, borderColor

Parameters

ctx

CanvasRenderingContext2D

Context to draw on

size

Point

object size x = width, y = height

Returns

void

Inherited from

Group.drawControlsConnectingLines


drawObject()

drawObject(ctx, forClipping, context): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:243

Execute the drawing operation for an object on a specified context

Parameters

ctx

CanvasRenderingContext2D

Context to render on

forClipping

boolean | undefined

context

DrawContext

Returns

void

Inherited from

Group.drawObject


drawSelectionBackground()

drawSelectionBackground(ctx): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:176

Draws a colored layer behind the object, inside its selection borders. Requires public options: padding, selectionBackgroundColor this function is called when the context is transformed has checks to be skipped when the object is on a staticCanvas

Parameters

ctx

CanvasRenderingContext2D

Context to draw on

Returns

void

Todo

evaluate if make this disappear in favor of a pre-render hook for objects this was added by Andrea Bogazzi to make possible some feature for work reasons it seemed a good option, now is an edge case

Inherited from

Group.drawSelectionBackground


findCommonAncestors()

findCommonAncestors<T>(other): AncestryComparison

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:656

Compare ancestors

Type Parameters

T

T extends IObjectFit

Parameters

other

T

Returns

AncestryComparison

an object that represent the ancestry situation.

Inherited from

Group.findCommonAncestors


findNewLowerIndex()

findNewLowerIndex(object, idx, intersecting?): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:46

Parameters

object

FabricObject

idx

number

intersecting?

boolean

Returns

number

Inherited from

Group.findNewLowerIndex


findNewUpperIndex()

findNewUpperIndex(object, idx, intersecting?): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:47

Parameters

object

FabricObject

idx

number

intersecting?

boolean

Returns

number

Inherited from

Group.findNewUpperIndex


fire()

fire<K>(eventName, options?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:65

Fires event with an optional options object

Type Parameters

K

K extends keyof GroupEvents

Parameters

eventName

K

Event name to fire

options?

GroupEvents[K]

Options object

Returns

void

Inherited from

Group.fire


forEachControl()

forEachControl(fn): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:165

Calls a function for each control. The function gets called, with the control, the control's key and the object that is calling the iterator

Parameters

fn

(control, key, fabricObject) => any

function to iterate over the controls over

Returns

void

Inherited from

Group.forEachControl


forEachObject()

forEachObject(callback): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:34

Parameters

callback

(object, index, array) => any

Returns

void

Inherited from

Group.forEachObject


get()

get(property): any

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/CommonMethods.d.ts:30

Basic getter

Parameters

property

string

Property name

Returns

any

value of a property

Inherited from

Group.get


getActiveControl()

getActiveControl(): { control: Control; coord: TOCoord; key: string; } | undefined

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:117

Returns

{ control: Control; coord: TOCoord; key: string; } | undefined

Inherited from

Group.getActiveControl


getAncestors()

getAncestors(): Ancestors

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:649

Returns

Ancestors

ancestors (excluding ActiveSelection) from bottom to top

Inherited from

Group.getAncestors


getBoundingRect()

getBoundingRect(): TBBox

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:155

Returns coordinates of object's bounding rectangle (left, top, width, height) the box is intended as aligned to axis of canvas.

Returns

TBBox

Object with left, top, width, height properties

Inherited from

Group.getBoundingRect


getCanvasRetinaScaling()

getCanvasRetinaScaling(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:186

Returns

number

Inherited from

Group.getCanvasRetinaScaling


getCenterPoint()

getCenterPoint(): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:306

Returns the center coordinates of the object relative to canvas

Returns

Point

Inherited from

Group.getCenterPoint


getCoords()

getCoords(): Point[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:111

Returns

Point[]

[tl, tr, br, bl] in the scene plane

Inherited from

Group.getCoords


getObjectOpacity()

getObjectOpacity(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:304

Return the object opacity counting also the group property

Returns

number

Inherited from

Group.getObjectOpacity


getObjects()

getObjects(...types): FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:35

Parameters

types

...string[]

Returns

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

Inherited from

Group.getObjects


getObjectScaling()

getObjectScaling(): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:294

Return the object scale factor counting also the group scaling

Returns

Point

Inherited from

Group.getObjectScaling


getPointByOrigin()

getPointByOrigin(originX, originY): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:316

Alias of getPositionByOrigin

Parameters

originX

TOriginX

originY

TOriginY

Returns

Point

Deprecated

use getPositionByOrigin instead

Inherited from

Group.getPointByOrigin


getPositionByOrigin()

getPositionByOrigin(originX, originY): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:329

This function is the mirror of setPositionByOrigin Returns the position of the object based on specified origin. Take an object that has left, top set to 100, 100 with origin 'left', 'top'. Return the values of left top ( wrapped in a point ) that you would need to keep the same position if origin where different ( ex: center, bottom ) Alternatively you can use this to also find which point in the parent plane is a specific origin ( where is the bottom right corner of my object? )

Parameters

originX

TOriginX

Horizontal origin: 'left', 'center' or 'right'

originY

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

Point

Inherited from

Group.getPositionByOrigin


getRelativeCenterPoint()

getRelativeCenterPoint(): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:311

Returns the center coordinates of the object relative to it's parent

Returns

Point

Inherited from

Group.getRelativeCenterPoint


getRelativeX()

getRelativeX(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:62

Returns

number

x position according to object's originX property in parent's coordinate plane
if parent is canvas then this property is identical to getX

Inherited from

Group.getRelativeX


getRelativeXY()

getRelativeXY(): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:96

Returns

Point

x,y position according to object's originX originY properties in parent's coordinate plane

Inherited from

Group.getRelativeXY


getRelativeY()

getRelativeY(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:72

Returns

number

y position according to object's originY property in parent's coordinate plane
if parent is canvas then this property is identical to getY

Inherited from

Group.getRelativeY


getScaledHeight()

getScaledHeight(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:167

Returns height of an object bounding box counting transformations

Returns

number

height value

Todo

shouldn't this account for group transform and return the actual size in canvas coordinate plane?

Inherited from

Group.getScaledHeight


getScaledWidth()

getScaledWidth(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:161

Returns width of an object's bounding box counting transformations

Returns

number

width value

Todo

shouldn't this account for group transform and return the actual size in canvas coordinate plane?

Inherited from

Group.getScaledWidth


getSvgCommons()

getSvgCommons(this): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts:25

Returns id attribute for svg output

Parameters

this

FabricObjectSVGExportMixin & FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents> & object

Returns

string

Inherited from

Group.getSvgCommons


getSvgFilter()

getSvgFilter(this): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts:20

Returns filter for svg shadow

Parameters

this

FabricObjectSVGExportMixin & FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

Returns

string

Inherited from

Group.getSvgFilter


getSvgStyles()

getSvgStyles(): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:285

Returns styles-string for svg-export, specific version for group

Returns

string

Inherited from

Group.getSvgStyles


getSvgTransform()

getSvgTransform(this, full?, additionalTransform?): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts:33

Returns transform-string for svg-export

Parameters

this

FabricObjectSVGExportMixin & FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

full?

boolean

additionalTransform?

string

Returns

string

Inherited from

Group.getSvgTransform


getTotalAngle()

getTotalAngle(): TDegree

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:191

Returns the object angle relative to canvas counting also the group property

Returns

TDegree

Inherited from

Group.getTotalAngle


getTotalObjectScaling()

getTotalObjectScaling(): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:299

Return the object scale factor counting also the group scaling, zoom and retina

Returns

Point

object with scaleX and scaleY properties

Inherited from

Group.getTotalObjectScaling


getViewportTransform()

getViewportTransform(): TMat2D

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:196

Retrieves viewportTransform from Object's canvas if available

Returns

TMat2D

Inherited from

Group.getViewportTransform


getX()

getX(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:45

Returns

number

x position according to object's originX property in canvas coordinate plane

Inherited from

Group.getX


getXY()

getXY(): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:81

Returns

Point

x position according to object's originX originY properties in canvas coordinate plane

Inherited from

Group.getXY


getY()

getY(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:53

Returns

number

y position according to object's originY property in canvas coordinate plane

Inherited from

Group.getY


groupInit()

protected groupInit(objects, options): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:118

Shared code between group and active selection Meant to be used by the constructor.

Parameters

objects

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

options
layoutManager?

LayoutManager

left?

number

top?

number

Returns

void

Inherited from

Group.groupInit


handleScaled()

handleScaled(shouldRenderCanvas?): void

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:31

Parameters

shouldRenderCanvas?

boolean

Returns

void


hasCommonAncestors()

hasCommonAncestors<T>(other): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:662

Type Parameters

T

T extends IObjectFit

Parameters

other

T

Returns

boolean

Inherited from

Group.hasCommonAncestors


hasFill()

hasFill(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:357

return true if the object will draw a fill Does not consider text styles. This is just a shortcut used at rendering time We want it to be an approximation and be fast. wrote to avoid extra caching, it has to return true when fill happens, can guess when it will not happen at 100% chance, does not matter if it misses some use case where the fill is invisible.

Returns

boolean

Boolean

Since

3.0.0

Inherited from

Group.hasFill


hasStroke()

hasStroke(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:346

return true if the object will draw a stroke Does not consider text styles. This is just a shortcut used at rendering time We want it to be an approximation and be fast. wrote to avoid extra caching, it has to return true when stroke happens, can guess when it will not happen at 100% chance, does not matter if it misses some use case where the stroke is invisible.

Returns

boolean

Boolean

Since

3.0.0

Inherited from

Group.hasStroke


insertAt()

insertAt(index, ...objects): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:146

Inserts an object into collection at specified index

Parameters

index

number

Index to insert object at

objects

...FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Object to insert

Returns

number

Inherited from

Group.insertAt


intersectsWithObject()

intersectsWithObject(other): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:121

Checks if object intersects with another object

Parameters

other

ObjectGeometry

Object to test

Returns

boolean

true if object intersects with another object

Inherited from

Group.intersectsWithObject


intersectsWithRect()

intersectsWithRect(tl, br): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:115

Checks if object intersects with the scene rect formed by tl and br

Parameters

tl

Point

br

Point

Returns

boolean

Inherited from

Group.intersectsWithRect


isCacheDirty()

isCacheDirty(skipCanvas?): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:417

Check if cache is dirty and if is dirty clear the context. This check has a big side effect, it changes the underlying cache canvas if necessary. Do not call this method on your own to check if the cache is dirty, because if it is, it is also going to wipe the cache. This is badly designed and needs to be fixed.

Parameters

skipCanvas?

boolean

skip canvas checks because this object is painted on parent canvas.

Returns

boolean

Inherited from

Group.isCacheDirty


isContainedWithinObject()

isContainedWithinObject(other): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:127

Checks if object is fully contained within area of another object

Parameters

other

ObjectGeometry

Object to test

Returns

boolean

true if object is fully contained within area of another object

Inherited from

Group.isContainedWithinObject


isContainedWithinRect()

isContainedWithinRect(tl, br): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:131

Checks if object is fully contained within the scene rect formed by tl and br

Parameters

tl

Point

br

Point

Returns

boolean

Inherited from

Group.isContainedWithinRect


isControlVisible()

isControlVisible(controlKey): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:232

Returns true if the specified control is visible, false otherwise.

Parameters

controlKey

string

The key of the control. Possible values are usually 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr', but since the control api allow for any control name, can be any string.

Returns

boolean

true if the specified control is visible, false otherwise

Inherited from

Group.isControlVisible


isDescendantOf()

isDescendantOf(target): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:645

Checks if object is descendant of target Should be used instead of Group.contains or StaticCanvas.contains for performance reasons

Parameters

target

TAncestor

Returns

boolean

Inherited from

Group.isDescendantOf


isEmpty()

isEmpty(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:37

Returns

boolean

Inherited from

Group.isEmpty


isInFrontOf()

isInFrontOf<T>(other): boolean | undefined

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:668

Type Parameters

T

T extends IObjectFit

Parameters

other

T

object to compare against

Returns

boolean | undefined

if objects do not share a common ancestor or they are strictly equal it is impossible to determine which is in front of the other; in such cases the function returns undefined

Inherited from

Group.isInFrontOf


isNotVisible()

isNotVisible(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:324

return if the object would be visible in rendering

Returns

boolean

Inherited from

Group.isNotVisible


isOnACache()

isOnACache(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:238

Check if instance or its group are caching, recursively up

Returns

boolean

Inherited from

Group.isOnACache


isOnScreen()

isOnScreen(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:144

Checks if object is contained within the canvas with current viewportTransform the check is done stopping at first point that appears on screen

Returns

boolean

true if object is fully or partially contained within canvas

Inherited from

Group.isOnScreen


isOverlapping()

isOverlapping<T>(other): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:132

Type Parameters

T

T extends ObjectGeometry<ObjectEvents>

Parameters

other

T

Returns

boolean

Inherited from

Group.isOverlapping


isPartiallyOnScreen()

isPartiallyOnScreen(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:149

Checks if object is partially contained within the canvas with current viewportTransform

Returns

boolean

true if object is partially contained within canvas

Inherited from

Group.isPartiallyOnScreen


isStrokeAccountedForInDimensions()

protected isStrokeAccountedForInDimensions(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:107

Returns

boolean

Deprecated

intermidiate method to be removed, do not use

Inherited from

Group.isStrokeAccountedForInDimensions


isType()

isType(...types): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:575

Checks if the instance is of any of the specified types. We use this to filter a list of objects for the getObjects function.

For detecting an instance type instanceOf is a better check, but to avoid to make specific classes a dependency of generic code internally we use this.

This compares both the static class type and the instance's own type property against the provided list of types.

Parameters

types

...string[]

A list of type strings to check against.

Returns

boolean

true if the object's type or class type matches any in the list, otherwise false.

Inherited from

Group.isType


item()

item(index): FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:36

Parameters

index

number

Returns

FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

Inherited from

Group.item


moveObjectTo()

moveObjectTo(object, index): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:45

Parameters

object

FabricObject

index

number

Returns

boolean

Inherited from

Group.moveObjectTo


needsItsOwnCache()

needsItsOwnCache(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:366

When returns true, force the object to have its own cache, even if it is inside a group it may be needed when your object behave in a particular way on the cache and always needs its own isolated canvas to render correctly. Created to be overridden since 1.7.12

Returns

boolean

Boolean

Inherited from

Group.needsItsOwnCache


off()

Call Signature

off<K>(eventName): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:44

Unsubscribe all event listeners for eventname. Do not use this pattern. You could kill internal fabricJS events. We know we should have protected events for internal flows, but we don't have yet

Type Parameters
K

K extends keyof GroupEvents

Parameters
eventName

K

event name (eg. 'after:render')

Returns

void

Deprecated
Inherited from

Group.off

Call Signature

off<K>(eventName, handler): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:50

unsubscribe an event listener

Type Parameters
K

K extends keyof GroupEvents

Parameters
eventName

K

event name (eg. 'after:render')

handler

TEventCallback

event listener to unsubscribe

Returns

void

Inherited from

Group.off

Call Signature

off(handlers): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:55

unsubscribe event listeners

Parameters
handlers

EventRegistryObject<EventSpec>

handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})

Returns

void

Inherited from

Group.off

Call Signature

off(): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:59

unsubscribe all event listeners

Returns

void

Inherited from

Group.off


on()

Call Signature

on<K, E>(eventName, handler): VoidFunction

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:19

Observes specified event

Type Parameters
K

K extends keyof GroupEvents

E

E extends TPointerEventInfo<TPointerEvent> | TPointerEventInfo<TPointerEvent> & object | TPointerEventInfo<WheelEvent> | TPointerEventInfo<TPointerEvent> & InEvent | TPointerEventInfo<TPointerEvent> & OutEvent | TPointerEventInfo<TPointerEvent> & object | TPointerEventInfo<TPointerEvent> & object | TPointerEventInfo<TPointerEvent> & TPointerEventInfo<TPointerEvent> & object | Partial<TEvent<TPointerEvent>> & object | Partial<TEvent<TPointerEvent>> & object | { target: Group | StaticCanvas<StaticCanvasEvents> | Canvas; } | { target: Group | StaticCanvas<StaticCanvasEvents> | Canvas; } | { path: FabricObject; } | { ctx: CanvasRenderingContext2D; } | TEventWithTarget<DragEvent> | DragEventData | DragEventData & InEvent | DragEventData & OutEvent | DropEventData | SimpleEventHandler<Event> | BasicTransformEvent<TPointerEvent> | BasicTransformEvent<TPointerEvent> & ModifyPathEvent | ModifiedEvent<TPointerEvent> | LayoutBeforeEvent | LayoutAfterEvent | { target: FabricObject; } | { target: FabricObject; }

Parameters
eventName

K

Event name (eg. 'after:render')

handler

TEventCallback<E>

Function that receives a notification when an event of the specified type occurs

Returns

VoidFunction

disposer

Alias

on

Inherited from

Group.on

Call Signature

on(handlers): VoidFunction

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:20

Observes specified event

Parameters
handlers

EventRegistryObject<EventSpec>

key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})

Returns

VoidFunction

disposer

Alias

on

Inherited from

Group.on


once()

Call Signature

once<K, E>(eventName, handler): VoidFunction

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:29

Observes specified event once

Type Parameters
K

K extends keyof GroupEvents

E

E extends TPointerEventInfo<TPointerEvent> | TPointerEventInfo<TPointerEvent> & object | TPointerEventInfo<WheelEvent> | TPointerEventInfo<TPointerEvent> & InEvent | TPointerEventInfo<TPointerEvent> & OutEvent | TPointerEventInfo<TPointerEvent> & object | TPointerEventInfo<TPointerEvent> & object | TPointerEventInfo<TPointerEvent> & TPointerEventInfo<TPointerEvent> & object | Partial<TEvent<TPointerEvent>> & object | Partial<TEvent<TPointerEvent>> & object | { target: Group | StaticCanvas<StaticCanvasEvents> | Canvas; } | { target: Group | StaticCanvas<StaticCanvasEvents> | Canvas; } | { path: FabricObject; } | { ctx: CanvasRenderingContext2D; } | TEventWithTarget<DragEvent> | DragEventData | DragEventData & InEvent | DragEventData & OutEvent | DropEventData | SimpleEventHandler<Event> | BasicTransformEvent<TPointerEvent> | BasicTransformEvent<TPointerEvent> & ModifyPathEvent | ModifiedEvent<TPointerEvent> | LayoutBeforeEvent | LayoutAfterEvent | { target: FabricObject; } | { target: FabricObject; }

Parameters
eventName

K

Event name (eg. 'after:render')

handler

TEventCallback<E>

Function that receives a notification when an event of the specified type occurs

Returns

VoidFunction

disposer

Alias

once

Inherited from

Group.once

Call Signature

once(handlers): VoidFunction

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/Observable.d.ts:30

Observes specified event once

Parameters
handlers

EventRegistryObject<EventSpec>

key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})

Returns

VoidFunction

disposer

Alias

once

Inherited from

Group.once


onDeselect()

onDeselect(_options?): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:267

This callback function is called every time _discardActiveObject or _setActiveObject try to to deselect this object. If the function returns true, the process is cancelled

Parameters

_options?

options sent from the upper functions

e?

TPointerEvent

object?

InteractiveFabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

Returns

boolean

Inherited from

Group.onDeselect


onDragStart()

onDragStart(_e): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:291

Override to customize Drag behavior
Fired once a drag session has started

Parameters

_e

DragEvent

Returns

boolean

true to handle the drag event

Inherited from

Group.onDragStart


onSelect()

onSelect(_options?): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:277

This callback function is called every time _discardActiveObject or _setActiveObject try to to select this object. If the function returns true, the process is cancelled

Parameters

_options?

options sent from the upper functions

e?

TPointerEvent

event if the process is generated by an event

Returns

boolean

Inherited from

Group.onSelect


positionByLeftTop()

positionByLeftTop(p): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:347

An utility method to position the object by its left top corner. Useful to reposition objects since now the default origin is center/center Places the left/top corner of the object bounding box in p.

Parameters

p

Point

Returns

void

Inherited from

Group.positionByLeftTop


recompute()

recompute(): void

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:33

Returns

void


remove()

remove(...objects): FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:152

Remove objects

Parameters

objects

...FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Returns

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

removed objects

Inherited from

Group.remove


removeAll()

removeAll(): FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:181

Remove all objects

Returns

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

removed objects

Inherited from

Group.removeAll


render()

render(ctx): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:254

Renders instance on a given context

Parameters

ctx

CanvasRenderingContext2D

context to render instance on

Returns

void

Inherited from

Group.render


renderCache()

renderCache(this, options?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:331

Parameters

this

TCachedFabricObject

options?

any

Returns

void

Inherited from

Group.renderCache


renderDragSourceEffect()

renderDragSourceEffect(_e): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:306

Override to customize drag and drop behavior render a specific effect when an object is the source of a drag event example: render the selection status for the part of text that is being dragged from a text object

Parameters

_e

DragEvent

Returns

void

Inherited from

Group.renderDragSourceEffect


renderDropTargetEffect()

renderDropTargetEffect(_e): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:315

Override to customize drag and drop behavior render a specific effect when an object is the target of a drag event used to show that the underly object can receive a drop, or to show how the object will change when dropping. example: show the cursor where the text is about to be dropped

Parameters

_e

DragEvent

Returns

void

Inherited from

Group.renderDropTargetEffect


rotate()

rotate(angle): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:590

Sets "angle" of an instance with centered rotation

Parameters

angle

TDegree

Angle value (in degrees)

Returns

void

Inherited from

Group.rotate


scale()

scale(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:173

Scales an object (equally by x and y)

Parameters

value

number

Scale factor

Returns

void

Inherited from

Group.scale


scaleToHeight()

scaleToHeight(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:185

Scales an object to a given height, with respect to bounding box (scaling by x/y equally)

Parameters

value

number

New height value

Returns

void

Inherited from

Group.scaleToHeight


scaleToWidth()

scaleToWidth(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:179

Scales an object to a given width, with respect to bounding box (scaling by x/y equally)

Parameters

value

number

New width value

Returns

void

Inherited from

Group.scaleToWidth


sendObjectBackwards()

sendObjectBackwards(object, intersecting?): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:43

Parameters

object

FabricObject

intersecting?

boolean

Returns

boolean

Inherited from

Group.sendObjectBackwards


sendObjectToBack()

sendObjectToBack(object): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:41

Parameters

object

FabricObject

Returns

boolean

Inherited from

Group.sendObjectToBack


set()

set(key, value?): this

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/CommonMethods.d.ts:18

Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) set does not update position of object's borders/controls. If you need to update those, call setCoords().

Parameters

key

string | Record<string, any>

Property name or object (if object, iterate over the object properties)

value?

any

Property value (if function, the value is passed into it and its return value is used as a new one)

Returns

this

Inherited from

Group.set


setControlsVisibility()

setControlsVisibility(options?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:247

Sets the visibility state of object controls, this is just a bulk option for setControlVisible;

Parameters

options?

Record<string, boolean>

with an optional key per control example: {Boolean} [options.bl] true to enable the bottom-left control, false to disable it

Returns

void

Inherited from

Group.setControlsVisibility


setControlVisible()

setControlVisible(controlKey, visible): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:241

Sets the visibility of the specified control. please do not use.

Parameters

controlKey

string

The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. but since the control api allow for any control name, can be any string.

visible

boolean

true to set the specified control visible, false otherwise

Returns

void

Todo

discuss this overlap of priority here with the team. Andrea Bogazzi for details

Inherited from

Group.setControlVisible


setCoords()

setCoords(): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:248

Returns

void

Inherited from

Group.setCoords


setObject()

setObject(object, useObjectTransform?, restorePreviousObjectTransform?): void

Defined in: src/packages/fabricjs-object-fit/src/types/i-object-fit.ts:23

Parameters

object

FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents> | null

useObjectTransform?

boolean

restorePreviousObjectTransform?

boolean

Returns

void


setOnGroup()

setOnGroup(): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:597

This callback function is called by the parent group of an object every time a non-delegated property changes on the group. It is passed the key and value as parameters. Not adding in this function's signature to avoid Travis build error about unused variables.

Returns

void

Inherited from

Group.setOnGroup


setOptions()

protected setOptions(options?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:284

Sets object's properties from options, for class constructor only. Needs to be overridden for different defaults.

Parameters

options?

Record<string, any>

Options object

Returns

void

Inherited from

Group.setOptions


setPositionByOrigin()

setPositionByOrigin(pos, originX, originY): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:337

Sets the position of the object taking into consideration the object's origin

Parameters

pos

Point

The new position of the object

originX

TOriginX

Horizontal origin: 'left', 'center' or 'right'

originY

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

void

Inherited from

Group.setPositionByOrigin


setRelativeX()

setRelativeX(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:67

Parameters

value

number

x position according to object's originX property in parent's coordinate plane
if parent is canvas then this method is identical to setX

Returns

void

Inherited from

Group.setRelativeX


setRelativeXY()

setRelativeXY(point, originX?, originY?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:103

As setXY, but in current parent's coordinate plane (the current group if any or the canvas)

Parameters

point

Point

position according to object's originX originY properties in parent's coordinate plane

originX?

TOriginX

Horizontal origin: 'left', 'center' or 'right'

originY?

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

void

Inherited from

Group.setRelativeXY


setRelativeY()

setRelativeY(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:77

Parameters

value

number

y position according to object's originY property in parent's coordinate plane
if parent is canvas then this property is identical to setY

Returns

void

Inherited from

Group.setRelativeY


setX()

setX(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:49

Parameters

value

number

x position according to object's originX property in canvas coordinate plane

Returns

void

Inherited from

Group.setX


setXY()

setXY(point, originX?, originY?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:92

Set an object position to a particular point, the point is intended in absolute ( canvas ) coordinate. You can specify originX and originY values, that otherwise are the object's current values.

Parameters

point

Point

position in scene coordinate plane

originX?

TOriginX

Horizontal origin: 'left', 'center' or 'right'

originY?

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

void

Example

ts
object.setXY(new Point(5, 5), 'left', 'bottom').

Inherited from

Group.setXY


setY()

setY(value): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:57

Parameters

value

number

y position according to object's originY property in canvas coordinate plane

Returns

void

Inherited from

Group.setY


shouldCache()

shouldCache(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:228

Decide if the group should cache or not. Create its own cache level needsItsOwnCache should be used when the object drawing method requires a cache step. Generally you do not cache objects in groups because the group is already cached.

Returns

boolean

Inherited from

Group.shouldCache


shouldStartDragging()

shouldStartDragging(_e): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:285

Override to customize Drag behavior Fired from Canvas#_onMouseMove

Parameters

_e

TPointerEvent

Returns

boolean

true in order for the window to start a drag session

Inherited from

Group.shouldStartDragging


size()

size(): number

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:38

Returns

number

Inherited from

Group.size


strokeBorders()

strokeBorders(ctx, size): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/InteractiveObject.d.ts:182

override this function in order to customize the drawing of the control box, e.g. rounded corners, different border style.

Parameters

ctx

CanvasRenderingContext2D

ctx is rotated and translated so that (0,0) is at object's center

size

Point

the control box size used

Returns

void

Inherited from

Group.strokeBorders


toBlob()

toBlob(options?): Promise<Blob | null>

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:560

Parameters

options?

toDataURLOptions

Returns

Promise<Blob | null>

Inherited from

Group.toBlob


toCanvasElement()

toCanvasElement(options?): HTMLCanvasElement

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:543

Converts an object into a HTMLCanvas element

Parameters

options?

ObjectToCanvasElementOptions

Options object

Returns

HTMLCanvasElement

Returns DOM element <canvas> with the FabricObject

Inherited from

Group.toCanvasElement


toClipPathSVG()

toClipPathSVG(reviver?): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:291

Returns svg clipPath representation of an instance

Parameters

reviver?

TSVGReviver

Method for further parsing of svg representation.

Returns

string

svg representation of an instance

Inherited from

Group.toClipPathSVG


toDatalessObject()

toDatalessObject(propertiesToInclude?): any

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:685

Returns (dataless) object representation of an instance

Parameters

propertiesToInclude?

any[]

Any properties that you might want to additionally include in the output

Returns

any

Object representation of an instance

Inherited from

Group.toDatalessObject


toDataURL()

toDataURL(options?): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:559

Converts an object into a data-url-like string

Parameters

options?

toDataURLOptions

Options object

Returns

string

Returns a data: URL containing a representation of the object in the format specified by options.format

Inherited from

Group.toDataURL


toggle()

toggle(property): this

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/CommonMethods.d.ts:24

Toggles specified property from true to false or from false to true

Parameters

property

string

Property to toggle

Returns

this

Inherited from

Group.toggle


toJSON()

toJSON(): any

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:585

Returns a JSON representation of an instance

Returns

any

JSON

Inherited from

Group.toJSON


toObject()

toObject<T, K>(propertiesToInclude?): Pick<T, K> & SerializedGroupProps

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:268

Returns object representation of an instance

Type Parameters

T

T extends Omit<GroupProps & TClassProperties<IObjectFit>, keyof SerializedGroupProps>

K

K extends string | number | symbol = never

Parameters

propertiesToInclude?

K[]

Any properties that you might want to additionally include in the output

Returns

Pick<T, K> & SerializedGroupProps

object representation of an instance

Inherited from

Group.toObject


toString()

toString(): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:269

Returns a string representation of an instance

Returns

string

Inherited from

Group.toString


toSVG()

toSVG(this, reviver?): string

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts:47

Returns svg representation of an instance

Parameters

this

FabricObjectSVGExportMixin & FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>

reviver?

TSVGReviver

Method for further parsing of svg representation.

Returns

string

svg representation of an instance

Inherited from

Group.toSVG


transform()

transform(ctx): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/Object.d.ts:289

Transforms context when rendering an object

Parameters

ctx

CanvasRenderingContext2D

Context

Returns

void

Inherited from

Group.transform


transformMatrixKey()

transformMatrixKey(skipGroup?): number[]

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:209

Parameters

skipGroup?

boolean

Returns

number[]

Inherited from

Group.transformMatrixKey


translateToCenterPoint()

translateToCenterPoint(point, originX, originY): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:293

Translates the coordinates from origin to center coordinates (based on the object's dimensions)

Parameters

point

Point

The point which corresponds to the originX and originY params

originX

TOriginX

Horizontal origin: 'left', 'center' or 'right'

originY

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

Point

Inherited from

Group.translateToCenterPoint


translateToGivenOrigin()

translateToGivenOrigin(point, fromOriginX, fromOriginY, toOriginX, toOriginY): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:285

Translates the coordinates from a set of origin to another (based on the object's dimensions)

Parameters

point

Point

The point which corresponds to the originX and originY params

fromOriginX

TOriginX

Horizontal origin: 'left', 'center' or 'right'

fromOriginY

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

toOriginX

TOriginX

Horizontal origin: 'left', 'center' or 'right'

toOriginY

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

Point

Inherited from

Group.translateToGivenOrigin


translateToOriginPoint()

translateToOriginPoint(center, originX, originY): Point

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Object/ObjectGeometry.d.ts:301

Translates the coordinates from center to origin coordinates (based on the object's dimensions)

Parameters

center

Point

The point which corresponds to center of the object

originX

TOriginX

Horizontal origin: 'left', 'center' or 'right'

originY

TOriginY

Vertical origin: 'top', 'center' or 'bottom'

Returns

Point

Inherited from

Group.translateToOriginPoint


triggerLayout()

triggerLayout(options?): void

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:249

Parameters

options?

ImperativeLayoutOptions

Returns

void

Inherited from

Group.triggerLayout


willDrawShadow()

willDrawShadow(): boolean

Defined in: node_modules/.pnpm/fabric@7.2.0/node_modules/fabric/dist/src/shapes/Group.d.ts:233

Check if this object or a child object will cast a shadow

Returns

boolean

Inherited from

Group.willDrawShadow