# Interface: IObjectFit

# Hierarchy

  • Group

    IObjectFit

# Table of contents

# Properties

# Methods

# Properties

# _controlsVisibility

_controlsVisibility: Object

# Type declaration

Name Type
bl? boolean
br? boolean
mb? boolean
ml? boolean
mr? boolean
mt? boolean
mtr? boolean
tl? boolean
tr? boolean

# Inherited from

fabric.Group._controlsVisibility

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3176


# _objects

_objects: Object[]

# Inherited from

fabric.Group._objects

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:251


# aCoords

Optional aCoords: Object

Describe object's corner position in canvas object absolute coordinates properties are tl,tr,bl,br and describe the four main corner. each property is an object with x, y, instance of Fabric.Point. The coordinates depends from this properties: width, height, scaleX, scaleY skewX, skewY, angle, strokeWidth, top, left. Those coordinates are usefull to understand where an object is. They get updated with oCoords but they do not need to be updated when zoom or panning change. The coordinates get updated with @method setCoords. You can calculate them without updating with @method calcCoords(true);

memberof fabric.Object.prototype

# Type declaration

Name Type
bl Point
br Point
tl Point
tr Point

# Inherited from

fabric.Group.aCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3147


# absolutePositioned

Optional absolutePositioned: boolean

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 false

# Inherited from

fabric.Group.absolutePositioned

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3111


# angle

Optional angle: number

Angle of rotation of an object (in degrees)

# Inherited from

fabric.Group.angle

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2750


# backgroundColor

Optional backgroundColor: string

Background color of an object. Only works with text objects at the moment.

# Inherited from

fabric.Group.backgroundColor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2851


# borderColor

Optional borderColor: string

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

# Inherited from

fabric.Group.borderColor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2790


# borderDashArray

Optional borderDashArray: number[]

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

# Inherited from

fabric.Group.borderDashArray

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2795


# borderOpacityWhenMoving

Optional borderOpacityWhenMoving: number

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

# Inherited from

fabric.Group.borderOpacityWhenMoving

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2905


# borderScaleFactor

Optional borderScaleFactor: number

Scale factor of object's controlling borders

# Inherited from

fabric.Group.borderScaleFactor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2910


# cacheProperties

Optional cacheProperties: string[]

List of properties to consider when checking if cache needs refresh Those properties are checked by statefullCache ON ( or lazy mode if we want ) or from single calls to Object.set(key, value). If the key is in this list, the object is marked as dirty and refreshed at the next render

# Inherited from

fabric.Group.cacheProperties

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3082


# canvas

Optional canvas: Canvas

The canvas the object belongs to

# Inherited from

fabric.Group.canvas

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3172


# centeredRotation

Optional centeredRotation: boolean

When true, this object will use center point as the origin of transformation when being rotated via the controls. Backwards incompatibility note: This property replaces "centerTransform" (Boolean).

# Inherited from

fabric.Group.centeredRotation

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2829


# centeredScaling

Optional centeredScaling: boolean

When true, this object will use center point as the origin of transformation when being scaled via the controls. Backwards incompatibility note: This property replaces "centerTransform" (Boolean).

# Inherited from

fabric.Group.centeredScaling

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2822


# clipPath

Optional clipPath: Object

A fabricObject that, without stroke define a clipping area with their shape. filled in black the clipPath object gets used when the object has rendered, and the context is placed in the center of the object cacheCanvas. If you want 0,0 of a clipPath to align with an object center, use clipPath.originX/Y to 'center'

# Inherited from

fabric.Group.clipPath

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3090


# controls

controls: Object

# Index signature

▪ [key: string]: Control

# Inherited from

fabric.Group.controls

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3188


# cornerColor

Optional cornerColor: string

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

# Inherited from

fabric.Group.cornerColor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2800


# cornerDashArray

Optional cornerDashArray: number[]

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

# Inherited from

fabric.Group.cornerDashArray

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2815


# cornerSize

Optional cornerSize: number

Size of object's controlling corners (in pixels)

# Inherited from

fabric.Group.cornerSize

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2765


# cornerStrokeColor

Optional cornerStrokeColor: string

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

# Inherited from

fabric.Group.cornerStrokeColor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2805


# cornerStyle

Optional cornerStyle: "rect" | "circle"

Specify style of control, 'rect' or 'circle'

# Inherited from

fabric.Group.cornerStyle

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2810


# data

Optional data: any

Not used by fabric, just for convenience

# Inherited from

fabric.Group.data

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3121


# dirty

Optional dirty: boolean

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

# Inherited from

fabric.Group.dirty

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3059


# enableRecomputeOnScaled

enableRecomputeOnScaled: boolean

# Defined in

src/types/IObjectFit.ts:19 (opens new window)


# enableRecomputeOnScaling

enableRecomputeOnScaling: boolean

# Defined in

src/types/IObjectFit.ts:21 (opens new window)


# evented

Optional evented: boolean

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

fabric.Group.evented

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2926


# excludeFromExport

Optional excludeFromExport: boolean

When true, object is not exported in OBJECT/JSON since 1.6.3

default

# Inherited from

fabric.Group.excludeFromExport

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3016


# fill

Optional fill: string | Pattern | Gradient

Color of object's fill

# Inherited from

fabric.Group.fill

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2834


# fillRule

Optional fillRule: string

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

# Inherited from

fabric.Group.fillRule

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2841


# flipX

Optional flipX: boolean

When true, an object is rendered as flipped horizontally

# Inherited from

fabric.Group.flipX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2735


# flipY

Optional flipY: boolean

When true, an object is rendered as flipped vertically

# Inherited from

fabric.Group.flipY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2740


# globalCompositeOperation

Optional globalCompositeOperation: string

Composite rule used for canvas globalCompositeOperation

# Inherited from

fabric.Group.globalCompositeOperation

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2846


# group

Optional group: Group

The group the object is part of

# Inherited from

fabric.Group.group

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3168


# hasBorders

Optional hasBorders: boolean

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

# Inherited from

fabric.Group.hasBorders

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2941


# hasControls

Optional hasControls: boolean

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

# Inherited from

fabric.Group.hasControls

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2936


# hasRotatingPoint

Optional hasRotatingPoint: boolean

When set to false, object's controlling rotating point will not be visible or selectable

# Inherited from

fabric.Group.hasRotatingPoint

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2946


# height

height: number

# Overrides

fabric.Group.height

# Defined in

src/types/IObjectFit.ts:13 (opens new window)


# hoverCursor

Optional hoverCursor: string

Default cursor value used when hovering over this object on canvas

# Inherited from

fabric.Group.hoverCursor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2775


# includeDefaultValues

Optional includeDefaultValues: boolean

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

# Inherited from

fabric.Group.includeDefaultValues

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2961


# inverted

Optional inverted: boolean

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 false

# Inherited from

fabric.Group.inverted

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3099


# left

Optional left: number

Left position of an object. Note that by default it's relative to object center. You can change this by setting originX={left/center/right}

# Inherited from

fabric.Group.left

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2710


# lockMovementX

Optional lockMovementX: boolean

When true, object horizontal movement is locked

# Inherited from

fabric.Group.lockMovementX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2966


# lockMovementY

Optional lockMovementY: boolean

When true, object vertical movement is locked

# Inherited from

fabric.Group.lockMovementY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2971


# lockRotation

Optional lockRotation: boolean

When true, object rotation is locked

# Inherited from

fabric.Group.lockRotation

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2976


# lockScalingFlip

Optional lockScalingFlip: boolean

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

# Inherited from

fabric.Group.lockScalingFlip

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3008


# lockScalingX

Optional lockScalingX: boolean

When true, object horizontal scaling is locked

# Inherited from

fabric.Group.lockScalingX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2981


# lockScalingY

Optional lockScalingY: boolean

When true, object vertical scaling is locked

# Inherited from

fabric.Group.lockScalingY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2986


# lockSkewingX

Optional lockSkewingX: boolean

When true, object horizontal skewing is locked

# Inherited from

fabric.Group.lockSkewingX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2997


# lockSkewingY

Optional lockSkewingY: boolean

When true, object vertical skewing is locked

# Inherited from

fabric.Group.lockSkewingY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3003


# lockUniScaling

Optional lockUniScaling: boolean

When true, object non-uniform scaling is locked

# Inherited from

fabric.Group.lockUniScaling

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2991


# matrixCache

Optional matrixCache: any

storage for object full transform matrix

# Inherited from

fabric.Group.matrixCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3151


# minScaleLimit

Optional minScaleLimit: number

Minimum allowed scale value of an object

# Inherited from

fabric.Group.minScaleLimit

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2915


# mode

mode: IFitMode

# Defined in

src/types/IObjectFit.ts:9 (opens new window)


# moveCursor

Optional moveCursor: string

Default cursor value used when moving an object on canvas

# Inherited from

fabric.Group.moveCursor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2780


# name

Optional name: string

Not used by fabric, just for convenience

# Inherited from

fabric.Group.name

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3116


# noScaleCache

Optional noScaleCache: boolean

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

# Inherited from

fabric.Group.noScaleCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3043


# oCoords

Optional oCoords: Object

Describe object's corner position in canvas element coordinates. properties are tl,mt,tr,ml,mr,bl,mb,br,mtr for the main controls. each property is an object with x, y and corner. The corner property contains in a similar manner the 4 points of the interactive area of the corner. The coordinates depends from this properties: width, height, scaleX, scaleY skewX, skewY, angle, strokeWidth, viewportTransform, top, left, padding. The coordinates get updated with @method setCoords. You can calculate them without updating with @method calcCoords;

memberof fabric.Object.prototype

# Type declaration

Name Type
bl Point
br Point
mb Point
ml Point
mr Point
mt Point
mtr Point
tl Point
tr Point

# Inherited from

fabric.Group.oCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3134


# object

object: null | Object

# Defined in

src/types/IObjectFit.ts:23 (opens new window)


# objectCaching

Optional objectCaching: boolean

When true, object is cached on an additional canvas.

# Inherited from

fabric.Group.objectCaching

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3021


# opacity

Optional opacity: number

Opacity of an object

# Inherited from

fabric.Group.opacity

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2745


# originX

Optional originX: string

Horizontal origin of transformation of an object (one of "left", "right", "center")

# Inherited from

fabric.Group.originX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2695


# originY

Optional originY: string

Vertical origin of transformation of an object (one of "top", "bottom", "center")

# Inherited from

fabric.Group.originY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2700


# ownMatrixCache

Optional ownMatrixCache: any

storage for object transform matrix

# Inherited from

fabric.Group.ownMatrixCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3155


# padding

Optional padding: number

Padding between object and its controlling borders (in pixels)

# Inherited from

fabric.Group.padding

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2785


# paintFirst

Optional paintFirst: string

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

# Inherited from

fabric.Group.paintFirst

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3065


# perPixelTargetFind

Optional perPixelTargetFind: boolean

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

# Inherited from

fabric.Group.perPixelTargetFind

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2956


# position

position: Partial<IPosition>

# Defined in

src/types/IObjectFit.ts:15 (opens new window)


# rotatingPointOffset

Optional rotatingPointOffset: number

Offset for object's controlling rotating point (when enabled via hasRotatingPoint)

# Inherited from

fabric.Group.rotatingPointOffset

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2951


# scaleX

Optional scaleX: number

Object scale factor (horizontal)

# Inherited from

fabric.Group.scaleX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2725


# scaleY

Optional scaleY: number

Object scale factor (vertical)

# Inherited from

fabric.Group.scaleY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2730


# selectable

Optional selectable: boolean

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

fabric.Group.selectable

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2921


# selectionBackgroundColor

Optional selectionBackgroundColor: string

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

# Inherited from

fabric.Group.selectionBackgroundColor

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2858


# shadow

Optional shadow: string | Shadow

Shadow object representing shadow of this shape

# Inherited from

fabric.Group.shadow

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2900


# skewX

Optional skewX: number

Object skew factor (horizontal)

# Inherited from

fabric.Group.skewX

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2755


# skewY

Optional skewY: number

Object skew factor (vertical)

# Inherited from

fabric.Group.skewY

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2760


# snapAngle

Optional snapAngle: number

Indicates the angle that an object will lock to while rotating. Can get from canvas.

# Inherited from

fabric.Group.snapAngle

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3160


# snapThreshold

Optional snapThreshold: null | number

Indicates the distance from the snapAngle the rotation will lock to the snapAngle. Can get from canvas.

# Inherited from

fabric.Group.snapThreshold

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3164


# stateProperties

Optional stateProperties: string[]

List of properties to consider when checking if state of an object is changed (fabric.Object#hasStateChanged) as well as for history (undo/redo) purposes

# Inherited from

fabric.Group.stateProperties

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3073


# statefullCache

Optional statefullCache: boolean

When true, object properties are checked for cache invalidation. In some particular situation you may want this to be disabled ( spray brush, very big, groups) or if your application does not allow you to modify properties for groups child you want to disable it for groups. default to false since 1.7.0

default false

# Inherited from

fabric.Group.statefullCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3033


# stroke

Optional stroke: string

When defined, an object is rendered via stroke and this property specifies its color

# Inherited from

fabric.Group.stroke

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2863


# strokeDashArray

Optional strokeDashArray: number[]

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

# Inherited from

fabric.Group.strokeDashArray

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2873


# strokeDashOffset

Optional strokeDashOffset: number

Line offset of an object's stroke

default

# Inherited from

fabric.Group.strokeDashOffset

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2880


# strokeLineCap

Optional strokeLineCap: string

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

# Inherited from

fabric.Group.strokeLineCap

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2885


# strokeLineJoin

Optional strokeLineJoin: string

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

# Inherited from

fabric.Group.strokeLineJoin

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2890


# strokeMiterLimit

Optional strokeMiterLimit: number

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

# Inherited from

fabric.Group.strokeMiterLimit

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2895


# strokeUniform

Optional strokeUniform: boolean

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. default to false

since 2.6.0

default false

# Inherited from

fabric.Group.strokeUniform

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3054


# strokeWidth

Optional strokeWidth: number

Width of a stroke used to render this object

# Inherited from

fabric.Group.strokeWidth

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2868


# subTargetCheck

Optional subTargetCheck: boolean

Indicates if click, mouseover, mouseout events & hoverCursor should also check for subtargets

# Inherited from

fabric.Group.subTargetCheck

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2300


# top

Optional top: number

Top position of an object. Note that by default it's relative to object center. You can change this by setting originY={top/center/bottom}

# Inherited from

fabric.Group.top

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2705


# transparentCorners

Optional transparentCorners: boolean

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

# Inherited from

fabric.Group.transparentCorners

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2770


# type

type: string

# Overrides

fabric.Group.type

# Defined in

src/types/IObjectFit.ts:7 (opens new window)


# useObjectTransform

useObjectTransform: boolean

# Defined in

src/types/IObjectFit.ts:17 (opens new window)


# useSetOnGroup

Optional useSetOnGroup: boolean

setOnGroup is a method used for TextBox that is no more used since 2.0.0 The behavior is still available setting this boolean to true.

since 2.0.0

default

# Inherited from

fabric.Group.useSetOnGroup

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2308


# visible

Optional visible: boolean

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

# Inherited from

fabric.Group.visible

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2931


# width

width: number

# Overrides

fabric.Group.width

# Defined in

src/types/IObjectFit.ts:11 (opens new window)

# Methods

# _applyPatternGradientTransform

Private _applyPatternGradientTransform(ctx, filler): void

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on
filler string | Pattern | Gradient fabric.Pattern or fabric.Gradient

# Returns

void

offset.offsetX offset for text rendering

# Inherited from

fabric.Group._applyPatternGradientTransform

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3945


# _calcBounds

Private _calcBounds(onlyWidthHeight?): void

# Parameters

Name Type
onlyWidthHeight? boolean

# Returns

void

# Inherited from

fabric.Group._calcBounds

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2427


# _findTargetCorner

Private _findTargetCorner(pointer): boolean | "bl" | "br" | "mb" | "ml" | "mr" | "mt" | "tl" | "tr" | "mtr"

Determines which corner has been clicked

# Parameters

Name Type Description
pointer Object The pointer indicating the mouse position
pointer.x number -
pointer.y number -

# Returns

boolean | "bl" | "br" | "mb" | "ml" | "mr" | "mt" | "tl" | "tr" | "mtr"

corner code (tl, tr, bl, br, etc.), or false if nothing is found

# Inherited from

fabric.Group._findTargetCorner

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3978


# _getControlsVisibility

Private _getControlsVisibility(): Object

Returns the instance of the control visibility set for this object.

# Returns

Object

Name Type
bl boolean
br boolean
mb boolean
ml boolean
mr boolean
mt boolean
mtr boolean
tl boolean
tr boolean

# Inherited from

fabric.Group._getControlsVisibility

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3961


# _getLeftTopCoords

Private _getLeftTopCoords(): Point

Returns the top, left coordinates

# Returns

Point

# Inherited from

fabric.Group._getLeftTopCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3902


# _getNonTransformedDimensions

_getNonTransformedDimensions(): Object

# Returns

Object

Name Type
x number
y number

# Inherited from

fabric.Group._getNonTransformedDimensions

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3896


# _getTransformedDimensions

_getTransformedDimensions(skewX?, skewY?): Object

# Parameters

Name Type
skewX? number
skewY? number

# Returns

Object

Name Type
x number
y number

# Inherited from

fabric.Group._getTransformedDimensions

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3909


# _onObjectRemoved

Private _onObjectRemoved(object): void

# Parameters

Name Type
object Object

# Returns

void

# Inherited from

fabric.Group._onObjectRemoved

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2443


# _removeShadow

Private _removeShadow(ctx): void

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group._removeShadow

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3925


# _render

Private _render(ctx): void

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group._render

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3950


# _renderFill

Private _renderFill(ctx): void

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group._renderFill

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3915


# _renderPaintInOrder

Private _renderPaintInOrder(ctx): void

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group._renderPaintInOrder

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3955


# _renderStroke

Private _renderStroke(ctx): void

# Parameters

Name Type
ctx CanvasRenderingContext2D

# Returns

void

# Inherited from

fabric.Group._renderStroke

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3920


# _restoreObjectsState

Private _restoreObjectsState(): Group

Retores original state of each of group objects (original state is that which was before group was created).

chainable

# Returns

Group

thisArg

# Inherited from

fabric.Group._restoreObjectsState

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2423

Private _restoreObjectsState(): Group

Retores original state of each of group objects (original state is that which was before group was created).

chainable

# Returns

Group

thisArg

# Inherited from

fabric.Group._restoreObjectsState

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2439


# _set

Private _set(key, value): Object

# Parameters

Name Type
key string
value any

# Returns

Object

# Inherited from

fabric.Group._set

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3987


# _setLineDash

Private _setLineDash(ctx, dashArray, alternative?): void

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to set the dash line on
dashArray number[] array representing dashes
alternative? (ctx: CanvasRenderingContext2D) => void function to call if browser does not support lineDash

# Returns

void

# Inherited from

fabric.Group._setLineDash

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3933


# _updateObjectsCoords

Private _updateObjectsCoords(center?): void

# Parameters

Name Type
center? Point

# Returns

void

# Inherited from

fabric.Group._updateObjectsCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2432


# add

add(...object): Group

Adds objects to collection, then renders canvas (if renderOnAddRemove is not false) Objects should be instances of (or inherit from) fabric.Object

# Parameters

Name Type Description
...object Object[] Zero or more fabric instances

# Returns

Group

# Inherited from

fabric.Group.add

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:258


# addWithUpdate

addWithUpdate(object?): Group

Adds an object to a group; Then recalculates group's dimension, position.

chainable

# Parameters

Name Type
object? Object

# Returns

Group

thisArg

# Inherited from

fabric.Group.addWithUpdate

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2324

addWithUpdate(object): Group

Adds an object to a group; Then recalculates group's dimension, position.

chainable

# Parameters

Name Type
object Object

# Returns

Group

thisArg

# Inherited from

fabric.Group.addWithUpdate

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2416


# adjustPosition

adjustPosition(to): void

# Parameters

Name Type Description
to string One of 'left', 'center', 'right'

# Returns

void

# Inherited from

fabric.Group.adjustPosition

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3592


# animate

animate(property, value, options?): Object

Animates object's properties object.animate('left', ..., {duration: ...});

# Parameters

Name Type Description
property string Property to animate
value string | number Value to animate property
options? IAnimationOptions The animation options

# Returns

Object

# Inherited from

fabric.Group.animate

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3765

animate(properties, options?): Object

Animates object's properties object.animate({ left: ..., top: ... }, { duration: ... });

# Parameters

Name Type Description
properties Object Properties to animate with values to animate to
options? IAnimationOptions The animation options

# Returns

Object

# Inherited from

fabric.Group.animate

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3772


# bringForward

bringForward(intersecting?): Object

Moves an object up in stack of drawn objects

# Parameters

Name Type
intersecting? boolean

# Returns

Object

# Inherited from

fabric.Group.bringForward

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3523


# bringToFront

bringToFront(): Object

Moves an object to the top of the stack of drawn objects

# Returns

Object

# Inherited from

fabric.Group.bringToFront

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3527


# calcCoords

calcCoords(absolute?): any

Calculate and returns the .coords of an object.

chainable

# Parameters

Name Type
absolute? boolean

# Returns

any

Object with tl, tr, br, bl ....

# Inherited from

fabric.Group.calcCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3778


# calcOwnMatrix

calcOwnMatrix(): any[]

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

# Returns

any[]

transform matrix for the object

# Inherited from

fabric.Group.calcOwnMatrix

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3791


# calcTransformMatrix

calcTransformMatrix(skipGroup?): any[]

calculate trasform Matrix that represent current transformation from object properties.

# Parameters

Name Type
skipGroup? boolean

# Returns

any[]

matrix Transform Matrix for the object

# Inherited from

fabric.Group.calcTransformMatrix

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3785


# center

center(): Object

Centers object vertically and horizontally on canvas to which is was added last You might need to call setCoords on an object after centering, to update controls area.

# Returns

Object

# Inherited from

fabric.Group.center

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3399


# centerH

centerH(): Object

Centers object horizontally on canvas to which it was added last. You might need to call setCoords on an object after centering, to update controls area.

# Returns

Object

# Inherited from

fabric.Group.centerH

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3371


# centerV

centerV(): Object

Centers object vertically on canvas to which it was added last. You might need to call setCoords on an object after centering, to update controls area.

# Returns

Object

# Inherited from

fabric.Group.centerV

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3385


# clone

clone(callback, propertiesToInclude?): void

Clones an instance, using a callback method will work for every object.

# Parameters

Name Type Description
callback Function Callback is invoked with a clone as a first argument
propertiesToInclude? string[] -

# Returns

void

# Inherited from

fabric.Group.clone

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3315


# cloneAsImage

cloneAsImage(callback, options?): Object

Creates an instance of fabric.Image out of an object

# Parameters

Name Type Description
callback Function callback, invoked with an instance as a first argument
options? IDataURLOptions -

# Returns

Object

# Inherited from

fabric.Group.cloneAsImage

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3321


# complexity

complexity(): number

Returns complexity of an instance

# Returns

number

# Inherited from

fabric.Group.complexity

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3353


# contains

contains(object): boolean

Returns true if collection contains an object

# Parameters

Name Type Description
object Object Object to check against

# Returns

boolean

true if collection contains an object

# Inherited from

fabric.Group.contains

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:316


# containsPoint

containsPoint(point, lines?, absolute?, calculate?): boolean

Checks if point is inside the object

# Parameters

Name Type Description
point Point Point to check against
lines? any -
absolute? boolean -
calculate? boolean -

# Returns

boolean

true if point is inside the object

# Inherited from

fabric.Group.containsPoint

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3723


# destroy

destroy(): Group

Destroys a group (restoring state of its objects)

chainable

# Returns

Group

thisArg

# Inherited from

fabric.Group.destroy

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2378


# detachObject

detachObject(restorePreviousObjectTransform?): null | Object

# Parameters

Name Type
restorePreviousObjectTransform? boolean

# Returns

null | Object

# Defined in

src/types/IObjectFit.ts:31 (opens new window)


# drawBorders

drawBorders(ctx, styleOverride?): Object

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

chainable

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to draw on
styleOverride? any object to override the object style

# Returns

Object

thisArg

# Inherited from

fabric.Group.drawBorders

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3605


# drawBordersInGroup

drawBordersInGroup(ctx, options?, styleOverride?): Object

Draws borders of an object's bounding box when it is inside a group. Requires public properties: width, height Requires public options: padding, borderColor

chainable

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to draw on
options? any object representing current object parameters
styleOverride? any object to override the object style

# Returns

Object

thisArg

# Inherited from

fabric.Group.drawBordersInGroup

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3617


# drawCacheOnCanvas

drawCacheOnCanvas(ctx): void

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

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group.drawCacheOnCanvas

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3301


# drawClipPathOnCache

drawClipPathOnCache(ctx): void

Execute the drawing operation for an object clipPath

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group.drawClipPathOnCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3289


# drawControls

drawControls(ctx, styleOverride?): Object

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

chainable

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to draw on
styleOverride? any object to override the object style

# Returns

Object

thisArg

# Inherited from

fabric.Group.drawControls

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3628


# drawCorners

drawCorners(context): Object

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

# Parameters

Name Type
context CanvasRenderingContext2D

# Returns

Object

# Inherited from

fabric.Group.drawCorners

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3647


# drawObject

drawObject(ctx): void

Execute the drawing operation for an object on a specified context

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to render on

# Returns

void

# Inherited from

fabric.Group.drawObject

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2359


# drawSelectionBackground

drawSelectionBackground(ctx): Object

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

chainable

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context to draw on

# Returns

Object

thisArg

# Inherited from

fabric.Group.drawSelectionBackground

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3639


# fire

fire(eventName, options?): Object

Fires event with an optional options object

memberof fabric.Observable

chainable

# Parameters

Name Type Description
eventName string Event name to fire
options? any -

# Returns

Object

thisArg

# Inherited from

fabric.Group.fire

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:363


# forEachObject

forEachObject(callback, context?): Group

Executes given function for each object in this group

# Parameters

Name Type Description
callback (element: Object, index: number, array: Object[]) => void -
context? any Context (aka thisObject)

# Returns

Group

thisArg

# Inherited from

fabric.Group.forEachObject

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:284


# fxStraighten

fxStraighten(callbacks): Object

Same as straighten but with animation

# Parameters

Name Type
callbacks Callbacks

# Returns

Object

# Inherited from

fabric.Group.fxStraighten

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3515


# get

get<K>(property): IObjectFit[K]

Basic getter

# Type parameters

Name Type
K extends keyof IObjectFit

# Parameters

Name Type Description
property K Property name

# Returns

IObjectFit[K]

# Inherited from

fabric.Group.get

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3420


# getBoundingRect

getBoundingRect(absolute?, calculate?): Object

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

# Parameters

Name Type
absolute? boolean
calculate? boolean

# Returns

Object

Object with left, top, width, height properties

Name Type
height number
left number
top number
width number

# Inherited from

fabric.Group.getBoundingRect

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3697


# getCenterPoint

getCenterPoint(): Point

Returns the real center coordinates of the object

# Returns

Point

# Inherited from

fabric.Group.getCenterPoint

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3563


# getCoords

getCoords(absolute?, calculate?): [Point, Point, Point, Point]

return correct set of coordinates for intersection

# Parameters

Name Type
absolute? boolean
calculate? boolean

# Returns

[Point, Point, Point, Point]

# Inherited from

fabric.Group.getCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3795


# getLocalPointer

getLocalPointer(e, pointer?): Object

Returns coordinates of a pointer relative to an object

# Parameters

Name Type Description
e undefined | Event Event to operate upon
pointer? Object -
pointer.x number -
pointer.y number -

# Returns

Object

Name Type
x number
y number

# Inherited from

fabric.Group.getLocalPointer

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3414


# getObjectOpacity

getObjectOpacity(): number

Return the object opacity counting also the group property

# Returns

number

# Inherited from

fabric.Group.getObjectOpacity

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3237


# getObjectScaling

getObjectScaling(): Object

Return the object scale factor counting also the group scaling

# Returns

Object

object with scaleX and scaleY properties

Name Type
scaleX number
scaleY number

# Inherited from

fabric.Group.getObjectScaling

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3225


# getObjects

getObjects(type?): Object[]

Returns an array of children objects of this instance Type parameter introduced in 1.3.10

# Parameters

Name Type
type? string

# Returns

Object[]

# Inherited from

fabric.Group.getObjects

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:291


# getPointByOrigin

getPointByOrigin(originX, originY): Point

Returns the coordinates of the object as if it has a different origin

# Parameters

Name Type Description
originX string Horizontal origin: 'left', 'center' or 'right'
originY string Vertical origin: 'top', 'center' or 'bottom'

# Returns

Point

# Inherited from

fabric.Group.getPointByOrigin

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3571


# getScaledHeight

getScaledHeight(): number

Returns height of an object bounding box counting transformations before 2.0 it was named getHeight();

# Returns

number

height value

# Inherited from

fabric.Group.getScaledHeight

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3801


# getScaledWidth

getScaledWidth(): number

Returns width of an object bounding box counting transformations before 2.0 it was named getWidth();

# Returns

number

width value

# Inherited from

fabric.Group.getScaledWidth

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3807


# getSvgCommons

getSvgCommons(): string

Returns id attribute for svg output

# Returns

string

# Inherited from

fabric.Group.getSvgCommons

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3812


# getSvgFilter

getSvgFilter(): string

Returns filter for svg shadow

# Returns

string

# Inherited from

fabric.Group.getSvgFilter

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3817


# getSvgSpanStyles

getSvgSpanStyles(style, useWhiteSpace?): string

Returns styles-string for svg-export

# Parameters

Name Type Description
style any the object from which to retrieve style properties
useWhiteSpace? boolean a boolean to include an additional attribute in the style.

# Returns

string

# Inherited from

fabric.Group.getSvgSpanStyles

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3824


# getSvgStyles

getSvgStyles(skipShadow?): string

Returns styles-string for svg-export

# Parameters

Name Type Description
skipShadow? boolean a boolean to skip shadow filter output

# Returns

string

# Inherited from

fabric.Group.getSvgStyles

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3474


# getSvgTextDecoration

getSvgTextDecoration(style): string

Returns text-decoration property for svg-export

# Parameters

Name Type Description
style any the object from which to retrieve style properties

# Returns

string

# Inherited from

fabric.Group.getSvgTextDecoration

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3830


# getSvgTransform

getSvgTransform(full?, additionalTransform?): string

Returns transform-string for svg-export

# Parameters

Name Type
full? boolean
additionalTransform? string

# Returns

string

# Inherited from

fabric.Group.getSvgTransform

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3480


# getSvgTransformMatrix

getSvgTransformMatrix(): string

Returns transform-string for svg-export from the transform matrix of single elements

# Returns

string

# Inherited from

fabric.Group.getSvgTransformMatrix

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3484


# getTotalObjectScaling

getTotalObjectScaling(): Object

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

# Returns

Object

object with scaleX and scaleY properties

Name Type
scaleX number
scaleY number

# Inherited from

fabric.Group.getTotalObjectScaling

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3231


# getViewportTransform

getViewportTransform(): any[]

Retrieves viewportTransform from Object's canvas if possible

# Returns

any[]

# Inherited from

fabric.Group.getViewportTransform

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3250


# handleScaled

handleScaled(shouldRenderCanvas?): void

# Parameters

Name Type
shouldRenderCanvas? boolean

# Returns

void

# Defined in

src/types/IObjectFit.ts:33 (opens new window)


# hasStateChanged

hasStateChanged(propertySet): boolean

Returns true if object state (one of its state properties) was changed

# Parameters

Name Type
propertySet string

# Returns

boolean

true if instance' state has changed since {@link fabric.Object#saveState} was called

# Inherited from

fabric.Group.hasStateChanged

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3493


# initialize

initialize(options?): Object

# Parameters

Name Type
options? IObjectOptions

# Returns

Object

# Inherited from

fabric.Group.initialize

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3191


# insertAt

insertAt(object, index, nonSplicing): Group

Inserts an object into collection at specified index, then renders canvas (if renderOnAddRemove is not false) An object should be an instance of (or inherit from) fabric.Object

chainable

# Parameters

Name Type Description
object Object Object to insert
index number Index to insert object at
nonSplicing boolean When true, no splicing (shifting) of objects occurs

# Returns

Group

thisArg

# Inherited from

fabric.Group.insertAt

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:269


# intersectsWithObject

intersectsWithObject(other, absolute?, calculate?): boolean

Checks if object intersects with another object

# Parameters

Name Type Description
other Object Object to test
absolute? boolean -
calculate? boolean -

# Returns

boolean

true if object intersects with another object

# Inherited from

fabric.Group.intersectsWithObject

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3747


# intersectsWithRect

intersectsWithRect(pointTL, pointBR, absolute?, calculate?): boolean

Checks if object intersects with an area formed by 2 points

# Parameters

Name Type Description
pointTL any top-left point of area
pointBR any bottom-right point of area
absolute? boolean -
calculate? boolean -

# Returns

boolean

true if object intersects with an area formed by 2 points

# Inherited from

fabric.Group.intersectsWithRect

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3756


# isCacheDirty

isCacheDirty(skipCanvas?): boolean

Check if cache is dirty

# Parameters

Name Type
skipCanvas? boolean

# Returns

boolean

# Inherited from

fabric.Group.isCacheDirty

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2363


# isContainedWithinObject

isContainedWithinObject(other, absolute?, calculate?): boolean

Checks if object is fully contained within area of another object

# Parameters

Name Type Description
other Object Object to test
absolute? boolean -
calculate? boolean -

# Returns

boolean

true if object is fully contained within area of another object

# Inherited from

fabric.Group.isContainedWithinObject

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3708


# isContainedWithinRect

isContainedWithinRect(pointTL, pointBR, absolute?, calculate?): boolean

Checks if object is fully contained within area formed by 2 points

# Parameters

Name Type Description
pointTL any top-left point of area
pointBR any bottom-right point of area
absolute? boolean -
calculate? boolean -

# Returns

boolean

# Inherited from

fabric.Group.isContainedWithinRect

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3714


# isControlVisible

isControlVisible(controlName): boolean

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

# Parameters

Name Type Description
controlName string The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.

# Returns

boolean

# Inherited from

fabric.Group.isControlVisible

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3653


# isEmpty

isEmpty(): boolean

Returns true if collection contains no objects

# Returns

boolean

true if collection is empty

# Inherited from

fabric.Group.isEmpty

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:303


# isOnACache

isOnACache(): boolean

Check if this group or its parent group are caching, recursively up

# Returns

boolean

# Inherited from

fabric.Group.isOnACache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2354


# isOnScreen

isOnScreen(calculate?): boolean

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

# Parameters

Name Type
calculate? boolean

# Returns

boolean

true if object is fully or partially contained within canvas

# Inherited from

fabric.Group.isOnScreen

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3837


# isPartiallyOnScreen

isPartiallyOnScreen(calculate?): boolean

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

# Parameters

Name Type
calculate? boolean

# Returns

boolean

true if object is partially contained within canvas

# Inherited from

fabric.Group.isPartiallyOnScreen

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3843


# isType

isType(type): boolean

Returns true if specified type is identical to the type of an instance

# Parameters

Name Type Description
type string Type to check against

# Returns

boolean

# Inherited from

fabric.Group.isType

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3348


# item

item(index): Group

Returns object at specified index

# Parameters

Name Type
index number

# Returns

Group

thisArg

# Inherited from

fabric.Group.item

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:297


# moveTo

moveTo(index): Object

Moves an object to specified level in stack of drawn objects

# Parameters

Name Type Description
index number New position of object

# Returns

Object

# Inherited from

fabric.Group.moveTo

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3541


# needsItsOwnCache

needsItsOwnCache(): boolean

When set to 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

false

# Inherited from

fabric.Group.needsItsOwnCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3266


# off

off(eventName?, handler?): Object

Stops event observing for a particular event handler. Calling this method without arguments removes all handlers for all events

# Parameters

Name Type Description
eventName? any Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
handler? (e: IEvent<Event>) => void Function to be deleted from EventListeners

# Returns

Object

# Inherited from

fabric.Group.off

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:353


# on

on(eventName, handler): Object

Observes specified event

# Parameters

Name Type Description
eventName "mouse:up" | "mouse:down" | "mouse:move" | "mouse:up:before" | "mouse:down:before" | "mouse:move:before" | "mouse:dblclick" | "mouse:over" | "mouse:out" Event name (eg. 'after:render')
handler (e: IEvent<MouseEvent>) => void Function that receives a notification when an event of the specified type occurs

# Returns

Object

# Inherited from

fabric.Group.on

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:331

on(eventName, handler): Object

# Parameters

Name Type
eventName "mouse:wheel"
handler (e: IEvent<WheelEvent>) => void

# Returns

Object

# Inherited from

fabric.Group.on

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:344

on(eventName, handler): Object

# Parameters

Name Type
eventName string
handler (e: IEvent<Event>) => void

# Returns

Object

# Inherited from

fabric.Group.on

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:345


# onDeselect

onDeselect(options): boolean

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

Name Type
options Object
options.e? Event
options.object? Object

# Returns

boolean

true to cancel selection

# Inherited from

fabric.Group.onDeselect

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3849

onDeselect(options): boolean

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

Name Type
options Object
options.e? Event
options.object? Object

# Returns

boolean

# Inherited from

fabric.Group.onDeselect

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3856


# onSelect

onSelect(options): boolean

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

Name Type
options Object
options.e? Event

# Returns

boolean

# Inherited from

fabric.Group.onSelect

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3861


# realizeTransform

realizeTransform(object): Object

Realises the transform from this group onto the supplied object i.e. it tells you what would happen if the supplied object was in the group, and then the group was destroyed. It mutates the supplied object.

# Parameters

Name Type
object Object

# Returns

Object

transformedObject

# Inherited from

fabric.Group.realizeTransform

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2372


# recompute

recompute(): void

# Returns

void

# Defined in

src/types/IObjectFit.ts:35 (opens new window)


# remove

remove(...object): Group

Removes objects from a collection, then renders canvas (if renderOnAddRemove is not false)

chainable

# Parameters

Name Type Description
...object Object[] Zero or more fabric instances

# Returns

Group

thisArg

# Inherited from

fabric.Group.remove

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:277


# removeWithUpdate

removeWithUpdate(object): Group

Removes an object from a group; Then recalculates group's dimension, position.

chainable

# Parameters

Name Type
object Object

# Returns

Group

thisArg

# Inherited from

fabric.Group.removeWithUpdate

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2330


# render

render(ctx): void

Renders instance on a given context

# Parameters

Name Type Description
ctx CanvasRenderingContext2D context to render instance on

# Returns

void

# Inherited from

fabric.Group.render

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2335


# rotate

rotate(angle): Object

Sets "angle" of an instance

# Parameters

Name Type Description
angle number Angle value

# Returns

Object

# Inherited from

fabric.Group.rotate

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3365


# saveState

saveState(options?): Object

Saves state of an object

# Parameters

Name Type
options? Object
options.propertySet? string
options.stateProperties? any[]

# Returns

Object

thisArg

# Inherited from

fabric.Group.saveState

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3499


# scale

scale(value): Object

Scales an object (equally by x and y)

# Parameters

Name Type Description
value number Scale factor

# Returns

Object

thisArg

# Inherited from

fabric.Group.scale

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3729


# scaleToHeight

scaleToHeight(value, absolute?): Object

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

# Parameters

Name Type Description
value number New height value
absolute? boolean -

# Returns

Object

# Inherited from

fabric.Group.scaleToHeight

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3734


# scaleToWidth

scaleToWidth(value, absolute?): Object

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

# Parameters

Name Type Description
value number New width value
absolute? boolean -

# Returns

Object

# Inherited from

fabric.Group.scaleToWidth

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3739


# sendBackwards

sendBackwards(intersecting?): Object

Moves an object down in stack of drawn objects

# Parameters

Name Type
intersecting? boolean

# Returns

Object

# Inherited from

fabric.Group.sendBackwards

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3532


# sendToBack

sendToBack(): Object

Moves an object to the bottom of the stack of drawn objects

# Returns

Object

# Inherited from

fabric.Group.sendToBack

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3536


# set

set<K>(key, value): Object

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().

# Type parameters

Name Type
K extends keyof IObjectFit

# Parameters

Name Type Description
key K Property name
value IObjectFit[K] | (value: IObjectFit[K]) => IObjectFit[K] Property value (if function, the value is passed into it and its return value is used as a new one)

# Returns

Object

# Inherited from

fabric.Group.set

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3429

set(options): Object

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

Name Type Description
options Partial<IObjectFit> Property object, iterate over the object properties

# Returns

Object

# Inherited from

fabric.Group.set

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3437


# setAngle

setAngle(angle): Object

Sets "angle" of an instance

# Parameters

Name Type Description
angle number Angle value

# Returns

Object

# Inherited from

fabric.Group.setAngle

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3455


# setControlVisible

setControlVisible(controlName, visible): Object

Sets the visibility of the specified control.

# Parameters

Name Type Description
controlName string The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.
visible boolean true to set the specified control visible, false otherwise

# Returns

Object

# Inherited from

fabric.Group.setControlVisible

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3659


# setControlsVisibility

setControlsVisibility(options?): IObjectFit

Sets the visibility state of object controls.

# Parameters

Name Type
options? Object
options.bl? boolean
options.br? boolean
options.mb? boolean
options.ml? boolean
options.mr? boolean
options.mt? boolean
options.mtr? boolean
options.tl? boolean
options.tr? boolean

# Returns

IObjectFit

# Inherited from

fabric.Group.setControlsVisibility

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3665


# setCoords

setCoords(skipCorners?): Object

Sets corner position coordinates based on current angle, width and height. oCoords are used to find the corners aCoords are used to quickly find an object on the canvas lineCoords are used to quickly find object during pointer events. See When-to-call-setCoords (opens new window)

chainable

# Parameters

Name Type
skipCorners? boolean

# Returns

Object

thisArg

# Inherited from

fabric.Group.setCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3689


# setObject

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

# Parameters

Name Type
object null | Object
useObjectTransform? boolean
restorePreviousObjectTransform? boolean

# Returns

void

# Defined in

src/types/IObjectFit.ts:25 (opens new window)


# setObjectsCoords

setObjectsCoords(): Group

Sets coordinates of all group objects

chainable

# Returns

Group

thisArg

# Inherited from

fabric.Group.setObjectsCoords

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2397


# setOnGroup

setOnGroup(): void

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

fabric.Group.setOnGroup

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3245


# setOptions

setOptions(options): void

Sets object's properties from options

# Parameters

Name Type
options IObjectOptions

# Returns

void

# Inherited from

fabric.Group.setOptions

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3196

setOptions(options?): void

Sets object's properties from options

# Parameters

Name Type
options? any

# Returns

void

# Inherited from

fabric.Group.setOptions

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3461


# setPositionByOrigin

setPositionByOrigin(pos, originX, originY): void

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

# Parameters

Name Type Description
pos Point The new position of the object
originX string Horizontal origin: 'left', 'center' or 'right'
originY string Vertical origin: 'top', 'center' or 'bottom'

# Returns

void

# Inherited from

fabric.Group.setPositionByOrigin

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3587


# setSourcePath

setSourcePath(value): Object

Sets sourcePath of an object

# Parameters

Name Type Description
value string Value to set sourcePath to

# Returns

Object

# Inherited from

fabric.Group.setSourcePath

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3449

setSourcePath(value): Object

Sets sourcePath of an object

# Parameters

Name Type Description
value string Value to set sourcePath to

# Returns

Object

# Inherited from

fabric.Group.setSourcePath

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3466


# setupState

setupState(options?): Object

Setups state of an object

# Parameters

Name Type
options? any

# Returns

Object

thisArg

# Inherited from

fabric.Group.setupState

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3505


# shouldCache

shouldCache(): boolean

Decide if the object should cache or not. Create its own cache level objectCaching is a global flag, wins over everything needsItsOwnCache should be used when the object drawing method requires a cache step. None of the fabric classes requires it. Generally you do not cache objects in groups because the group outside is cached.

# Returns

boolean

# Inherited from

fabric.Group.shouldCache

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2344


# size

size(): number

Returns a size of a collection (i.e: length of an array containing its objects)

# Returns

number

Collection size

# Inherited from

fabric.Group.size

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:309


# straighten

straighten(): Object

Straightens an object (rotating it from current angle to one of 0, 90, 180, 270, etc. depending on which is closer)

# Returns

Object

# Inherited from

fabric.Group.straighten

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3511


# toActiveSelection

toActiveSelection(): ActiveSelection

make a group an active selection, remove the group from canvas the group has to be on canvas for this to work.

chainable

# Returns

ActiveSelection

thisArg

# Inherited from

fabric.Group.toActiveSelection

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2385


# toCanvasElement

toCanvasElement(options?): HTMLCanvasElement

Converts an object into a HTMLCanvas element

# Parameters

Name Type Description
options? IDataURLOptions Options object

# Returns

HTMLCanvasElement

Returns a new HTMLCanvasElement painted with the current canvas object

# Inherited from

fabric.Group.toCanvasElement

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3336


# toClipPathSVG

toClipPathSVG(reviver?): string

Returns svg clipPath representation of an instance

# Parameters

Name Type
reviver? Function

# Returns

string

svg representation of an instance

# Inherited from

fabric.Group.toClipPathSVG

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2409


# toDataURL

toDataURL(options): string

Converts an object into a data-url-like string

# Parameters

Name Type Description
options IDataURLOptions Options object

# Returns

string

# Inherited from

fabric.Group.toDataURL

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3342


# toDatalessObject

toDatalessObject(propertiesToInclude?): any

Returns (dataless) object representation of an instance

# Parameters

Name Type
propertiesToInclude? string[]

# Returns

any

# Inherited from

fabric.Group.toDatalessObject

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3214


# toJSON

toJSON(propertiesToInclude?): any

Returns a JSON representation of an instance

# Parameters

Name Type
propertiesToInclude? string[]

# Returns

any

# Inherited from

fabric.Group.toJSON

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3359


# toLocalPoint

toLocalPoint(point, originX, originY): Point

Returns the point in local coordinates

# Parameters

Name Type Description
point Point The point relative to the global coordinate system
originX string Horizontal origin: 'left', 'center' or 'right'
originY string Vertical origin: 'top', 'center' or 'bottom'

# Returns

Point

# Inherited from

fabric.Group.toLocalPoint

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3579


# toObject

toObject(propertiesToInclude?): IObjectFitSerialized

# Parameters

Name Type
propertiesToInclude? string[]

# Returns

IObjectFitSerialized

# Overrides

fabric.Group.toObject

# Defined in

src/types/IObjectFit.ts:37 (opens new window)


# toSVG

toSVG(reviver?): string

Returns svg representation of an instance

# Parameters

Name Type
reviver? Function

# Returns

string

svg representation of an instance

# Inherited from

fabric.Group.toSVG

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2403


# toString

toString(): string

Returns a string representation of an instance

# Returns

string

# Inherited from

fabric.Group.toString

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3219


# toggle

toggle(property): Object

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

# Parameters

Name Type Description
property keyof IObjectFit Property to toggle

# Returns

Object

# Inherited from

fabric.Group.toggle

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3443


# transform

transform(ctx): void

Transforms context when rendering an object

# Parameters

Name Type Description
ctx CanvasRenderingContext2D Context

# Returns

void

# Inherited from

fabric.Group.transform

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3202


# translateToCenterPoint

translateToCenterPoint(point, originX, originY): Point

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

# Parameters

Name Type Description
point Point The point which corresponds to the originX and originY params
originX string Horizontal origin: 'left', 'center' or 'right'
originY string Vertical origin: 'top', 'center' or 'bottom'

# Returns

Point

# Inherited from

fabric.Group.translateToCenterPoint

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3551


# translateToGivenOrigin

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

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

# Parameters

Name Type Description
pointL Point -
fromOriginX string Horizontal origin: 'left', 'center' or 'right'
fromOriginY string Vertical origin: 'top', 'center' or 'bottom'
toOriginX string Horizontal origin: 'left', 'center' or 'right'
toOriginY string Vertical origin: 'top', 'center' or 'bottom'

# Returns

Point

# Inherited from

fabric.Group.translateToGivenOrigin

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3883


# translateToOriginPoint

translateToOriginPoint(center, originX, originY): Point

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

# Parameters

Name Type Description
center Point The point which corresponds to center of the object
originX string Horizontal origin: 'left', 'center' or 'right'
originY string Vertical origin: 'top', 'center' or 'bottom'

# Returns

Point

# Inherited from

fabric.Group.translateToOriginPoint

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3559


# ungroupOnCanvas

ungroupOnCanvas(): Group

Destroys a group (restoring state of its objects)

chainable

# Returns

Group

thisArg

# Inherited from

fabric.Group.ungroupOnCanvas

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2391


# viewportCenter

viewportCenter(): Object

Centers object on current viewport of canvas to which it was added last. You might need to call setCoords on an object after centering, to update controls area.

chainable

# Returns

Object

thisArg

# Inherited from

fabric.Group.viewportCenter

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3407


# viewportCenterH

viewportCenterH(): Object

Centers object horizontally on current viewport of canvas to which it was added last. You might need to call setCoords on an object after centering, to update controls area.

chainable

# Returns

Object

thisArg

# Inherited from

fabric.Group.viewportCenterH

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3379


# viewportCenterV

viewportCenterV(): Object

Centers object vertically on current viewport of canvas to which it was added last. You might need to call setCoords on an object after centering, to update controls area.

chainable

# Returns

Object

thisArg

# Inherited from

fabric.Group.viewportCenterV

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:3393


# willDrawShadow

willDrawShadow(): boolean

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

# Returns

boolean

# Inherited from

fabric.Group.willDrawShadow

# Defined in

node_modules/@types/fabric/fabric-impl.d.ts:2349