Protected Optional __cleanupOptional reason: anyProtected Optional _absoluteOptional _activeProtected _activePrivate _currenthold a reference to a data structure that contains information on the current on going transform
Private Optional _dragHolds a reference to an object on the canvas from where the drag operation started
Private Optional _draggedoverHolds a reference to an object on the canvas that is receiving the drag over event.
Private _dropHolds a reference to an object on the canvas that is the current drop target May differ from _draggedoverTarget
inspect whether _draggedoverTarget and _dropTarget should be merged somehow
Private _grouphold a reference to a data structure used to track the selection box on canvas drag on the current on going transform
Optional Private _hoveredKeep track of the hovered target
Private _hoveredhold the list of nested targets hovered
Private _isProtected _isOptional Private _objectshold the list of objects to render
Protected Optional _pointerDuring a mouse event we may need the pointer multiple times in multiple functions. _pointer holds a reference to the pointer in html coordinates that is valid for the event lifespan. Every fabricJS mouse event create and delete the cache every time We do this because there are some HTML DOM inspection functions to get the actual pointer coordinates
Protected Optional _targetDuring a mouse event we may need the target multiple times in multiple functions. _target holds a reference to the target that is valid for the event lifespan. Every fabricJS mouse event create and delete the cache every time
Private _willHolds a reference to a setTimeout timer for event synchronization
move to Canvas
Indicates which key enable alternate action on corner
values: 'altKey', 'shiftKey', 'ctrlKey'.
If null or 'none' or any other string that is not a modifier key
feature is disabled feature disabled.
1.6.2
Indicates which key enable alternative selection
in case of target overlapping with active object
values: 'altKey', 'shiftKey', 'ctrlKey'.
For a series of reason that come from the general expectations on how
things should work, this feature works only for preserveObjectStacking true.
If null or 'none' or any other string that is not a modifier key
feature is disabled.
1.6.5
Background color of canvas instance.
Optional backgroundBackground image of canvas instance. since 2.4.0 image caching is active, please when putting an image as background, add to the canvas property a reference to the canvas it is on. Otherwise the image cannot detect the zoom vale. As an alternative you can disable image objectCaching
if set to false background image is not affected by viewport transform
1.6.3
we should really find a different way to do this
Indicates which key enable centered Transform
values: 'altKey', 'shiftKey', 'ctrlKey'.
If null or 'none' or any other string that is not a modifier key
feature is disabled feature disabled.
1.6.2
When true, objects use center point as the origin of rotate transformation. Backwards incompatibility note: This property replaces "centerTransform" (Boolean).
1.3.4
When true, objects use center point as the origin of scale transformation. Backwards incompatibility note: This property replaces "centerTransform" (Boolean).
1.3.4
Optional clipa fabricObject that, without stroke define a clipping area with their shape. filled in black the clipPath object gets used when the canvas has rendered, and the context is placed in the top left corner of the canvas. clipPath will clip away controls, if you do not want this to happen use controlsAboveOverlay = true
Default element class that's given to wrapper (div) element of canvas
Private contextinternal flag used to understand if the context top requires a cleanup in case this is true, the contextTop will be cleared at the next render
move to Canvas
Optional currentOptional currentDefault cursor value used for the entire canvas
default
Optional destroyedIf true the Canvas is in the process or has been disposed/destroyed. No more rendering operation will be executed on this canvas.
Optional disposedStarted the process of disposing but not done yet. WIll likely complete the render cycle already scheduled but stopping adding more.
When the option is enabled, PointerEvent is used instead of TPointerEvent.
When true, canvas is scaled by devicePixelRatio for better rendering on retina screens
Indicates if the canvas can fire middle click events
1.7.8
Indicates if the canvas can fire right click events
1.6.5
Optional freeCursor value used during free drawing
crosshair
Protected hasHeight in virtual/logical pixels of the canvas. The canvas can be taller than width if retina scaling is active
Default cursor value used when hovering over an object on canvas
move
Indicates whether this canvas will use image smoothing, this is on by default in browsers
Indicates whether toObject/toDatalessObject should include default values if set to false, takes precedence over the object value.
When true, mouse events on canvas (mousedown/mousemove/mouseup) result in free drawing.
After mousedown, mousemove creates a shape,
and then mouseup finalizes it and adds an instance of fabric.Path onto canvas.
Private mainContains the id of the touch event that owns the fabric transform
Default cursor value used when moving an object on canvas
move
Protected nextCursor value used for disabled elements ( corners with disabled action )
2.0.0
not-allowed
Overlay color of canvas instance.
1.3.9
Optional overlayOverlay image of canvas instance. since 2.4.0 image caching is active, please when putting an image as overlay, add to the canvas property a reference to the canvas it is on. Otherwise the image cannot detect the zoom vale. As an alternative you can disable image objectCaching
if set to false overlay image is not affected by viewport transform
1.6.3
we should really find a different way to do this
When true, object detection happens on per-pixel basis rather than on per-bounding-box
Indicates whether objects should remain in current stack position when selected. When false objects are brought to top and rendered as part of the selection group
Indicates whether StaticCanvas#add, StaticCanvas#insertAt and StaticCanvas#remove, StaticCanvas#moveTo, StaticCanvas#clear and many more, should also re-render canvas. Disabling this option will not give a performance boost when adding/removing a lot of objects to/from canvas at once since the renders are queued and executed one per frame. Disabling is suggested anyway and managing the renders of the app manually is not a big effort ( canvas.requestRenderAll() ) Left default to true to do not break documentation and old app, fiddles.
Indicates whether group selection should be enabled
Color of the border of selection (usually slightly darker than color of selection itself)
Color of selection
Default dash array pattern If not empty the selection border is dashed
Select only shapes that are fully contained in the dragged selection rectangle.
Indicates which key or keys enable multiple click selection
Pass value as a string or array of strings
values: 'altKey', 'shiftKey', 'ctrlKey'.
If null or empty or containing any other string that is not a modifier key
feature is disabled.
1.6.2
Width of a line used in object/group selection
Based on vptCoords and object.aCoords, skip rendering of objects that are not included in current viewport. May greatly help in applications with crowded canvas and use of zoom/pan If One of the corner of the bounding box of the object is on the canvas the objects get rendered.
true
When true, target detection is skipped. Target detection will return always undefined.
click selection won't work anymore, events will fire with no targets.
if something is selected before setting it to true, it will be deselected at the first click.
area selection will still work. check the selection property too.
if you deactivate both, you should look into staticCanvas.
Indicates if the right click on canvas can output the context menu or not
1.6.5
When true, getSvgTransform() will apply the StaticCanvas.viewportTransform to the SVG transformation. When true, a zoomed canvas will then produce zoomed SVG output.
Number of pixels around target pixel to tolerate (consider active) during object detection
Keep track of the subTargets for Mouse Events
Indicates which key switches uniform scaling.
values: 'altKey', 'shiftKey', 'ctrlKey'.
If null or 'none' or any other string that is not a modifier key
feature is disabled.
totally wrong named. this sounds like uniform scaling
if Canvas.uniformScaling is true, pressing this will set it to false
and viceversa.
1.6.2
When true, objects can be transformed by one side (unproportionately) when dragged on the corners that normally would not do that.
fabric 4.0 // changed name and default value
The transformation (a Canvas 2D API transform matrix) which focuses the viewport
Default transform
canvas.viewportTransform = [1, 0, 0, 1, 0, 0];
Scale by 70% and translate toward bottom-right by 50, without skewing
canvas.viewportTransform = [0.7, 0, 0, 0.7, 50, 50];
Describe canvas element extension over design properties are tl,tr,bl,br. if canvas is not zoomed/panned those points are the four corner of canvas if canvas is viewportTransformed you those points indicate the extension of canvas element in plain untrasformed coordinates The coordinates get updated with
calcViewportBoundaries.
Width in virtual/logical pixels of the canvas. The canvas can be larger than width if retina scaling is active
Static ownA reference to the canvas actual HTMLCanvasElement. Can be use to read the raw pixels, but never write or manipulate
Private __onPrivate
Method that defines the actions when mouse is clicked on canvas. The method inits the currentTransform parameters and renders all the canvas so the current image can be placed on the top canvas and the rest in on the container one.
Event object fired on mousedown
Private __onPrivate
Method that defines the actions when mouse is hovering the canvas. The currentTransform parameter will define whether the user is rotating/scaling/translating an image or neither of them (only hovering). A group selection is also possible and would cancel all any other type of action. In case of an image transformation only the top canvas will be rendered.
Event object fired on mousemove
Private __onPrivate
Method that defines the actions when mouse is released on canvas. The method resets the currentTransform parameters, store the image corner position in the image object and render the canvas on top.
Event object fired on mouseup
Method that defines actions when an Event Mouse Wheel
Event object fired on mouseup
Private __serializePrivate
Optional propertiesToInclude: string[]Private _beforePrivate _cachePrivate
Cache common information needed during event processing
Event object fired on event
Private _centerPrivate
Object to center
Center point
Private _checkPrivate
Checks point is inside the object.
Object to test against
Optional pointer: Pointpoint from viewport.
true if point is contained within an area of given object
Divides objects in two groups, one to render immediately and one to render as activeGroup.
objects to render immediately and pushes the other in the activeGroup.
Protected _createThis is supposed to be equivalent to discardActiveObject but without firing any selection events ( can still fire object transformation events ). There is commitment to have this stay this way. This is the functional part of discardActiveObject.
Optional e: TPointerEventEvent (passed along when firing "object:deselected")
Optional object: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>the next object to set as active, reason why we are discarding this
true if the active object has been discarded
Private _drawPrivate _finalizePrivate
send the mouse event that generate the finalize down, so it can be used in the event
Private _firePrivate
Manage the dragEnter, dragLeave events for the fabric objects on the canvas
the target where the target from the onDrag event
Event object fired on dragover
Private _firePrivate
Manage the mouseout, mouseover events for the fabric object on the canvas
Event object fired on mousemove
Optional target: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>the target where the target from the mousemove event
Private _firePrivate
Compares the old activeObject with the current one and fires correct events
old activeObject
Optional e: TPointerEventmouse event triggering the selection events
Private _getPrivate _getPrivate
Given the control clicked, determine the origin of the transform. This is bad because controls can totally have custom names should disappear before release 4.0
Private _handlePrivate
Handle event firing for target and subtargets
event from mouse
event to fire (up, down or move)
Optional button: number = LEFT_CLICKbutton used in the event 1 = left, 2 = middle, 3 = right
for left button only, indicates that the mouse up happened without move.
Private _isPrivate
Determines if an event has the id of the event that is considered main
Private _isPrivate _isPrivate
takes an event and determines if selection key has been pressed
Event object
Private _onPrivate
Event object fired on mousedown
Private _onPrivate
Event object fired on mousedown
Private _onPrivate
supports native like text dragging https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#finishing_a_drag
Private _onPrivate _onPrivate _onPrivate
prevent default to allow drop event to be fired https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#specifying_drop_targets
Optional e: DragEventEvent object fired on Event.js shake
Private _onPrivate _onPrivate _onPrivate
drop:before is a an event that allows you to schedule logic
before the drop event. Prefer drop event always, but if you need
to run some drop-disabling logic on an event, since there is no way
to handle event handlers ordering, use drop:before
Private _onPrivate
Event object fired on mousedown
Private _onPrivate
Event object fired on mousedown
Private _onPrivate
Event object fired on mouseenter
Private _onPrivate
Event object fired on mousemove
Private _onPrivate
Event object fired on mousemove
Private _onPrivate
Event object fired on mousedown
Private _onPrivate
Event object fired on mouseup
Private _onPrivate
Event object fired on mouseup
Private _onPrivate _onPrivate
Object that was added
Private _onPrivate
Object that was removed
Private _onPrivate _onPrivate _onPrivate _performPrivate
Private _realizePrivate
Realizes an object's group transformation on it
Optional instance: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>the object to transform (gets mutated)
the original values of instance which were changed
Private _renderPrivate _renderPrivate _renderPrivate
First we clear top context where the effects are being rendered.
Then we render the effects.
Doing so will render the correct effect for all cases including an overlap between source and target.
Optional source: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>Optional target: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>Private _renderPrivate
Context to render on
to render
Private _renderPrivate _resetPrivate _searchPrivate
Internal Function used to search inside objects an object that contains pointer in bounding box or that contains pointerOnCanvas when painted
Optional objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]objects array to look into
Optional pointer: Pointx,y object of point coordinates we want to check.
top most object from given objects that contains pointer
This is supposed to be equivalent to setActiveObject but without firing any event. There is commitment to have this stay this way. This is the functional part of setActiveObject.
to set as active
Optional e: TPointerEventEvent (passed along when firing "object:selected")
true if the object has been selected
Sets the cursor depending on where the canvas is being hovered. Note: very buggy in Opera
Event object
Optional target: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>Object that the mouse is hovering, if so.
Protected _setProtected
Internal use only
Optional options: TCanvasSizeOptionsPrivate _setProtected _setPrivate _setSVGBgPrivate _setSVGBgPrivate
Private _setSVGHeaderPrivate
Private _setSVGObjectPrivate
Private _setSVGObjectsPrivate
Private _setSVGPreamblePrivate
Private _setupPrivate
Event object
Private _shouldPrivate
Event object
Optional target: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>Private _shouldPrivate
Decides whether the canvas should be redrawn in mouseup and mousedown events.
Private _toPrivate
Private _toPrivate
Optional propertiesToInclude: string[]Private _transformPrivate
Event fired on mousemove
Pan viewport so as to place point at top left corner of canvas
to move to
Rest ...objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]Moves an object or a selection up in stack of drawn objects An optional parameter, intersecting allows to move the object in front of the first intersecting object. Where intersection is calculated with bounding box. If no intersection is found, there will not be change in the stack.
Object to send
Optional intersecting: booleanIf true, send object in front of next upper intersecting object
true if change occurred
Moves an object or the objects of a multiple selection to the top of the stack of drawn objects
Object to send
true if change occurred
Calculate the position of the 4 corner of canvas with current viewportTransform. helps to determinate when an object is in the current rendering viewport using object absolute coordinates ( aCoords )
points.tl
Centers object vertically and horizontally in the canvas
Object to center vertically and horizontally
Centers object horizontally in the canvas
Centers object vertically in the canvas
Object to center vertically
clear textEditingManager
Given a bounding box, return all the objects of the collection that are contained in the bounding box.
If includeIntersecting is true, return also the objects that intersect the bounding box as well.
This is meant to work with selection. Is not a generic method.
Optional includearray of objects contained in the bounding box, ordered from top to bottom stacking wise
Returns true if collection contains an object.
Prefer using FabricObject#isDescendantOf for performance reasons
instead of a.contains(b) use b.isDescendantOf(a)
Object to check against
Optional deep: booleantrue to check all descendants, false to check only _objects
true if collection contains an object
clear textEditingManager
Discards currently active object and fire events. If the function is called by fabric as a consequence of a mouse event, the event is passed as a parameter and sent to the fire function for the custom events. When used as a method the e param does not have any application.
Optional e: TPointerEventtrue if the active object has been discarded
Paint the cached clipPath on the lowerCanvasEl
Context to render on
End the current transform. You don't usually need to call this method unless you are interrupting a user initiated transform because of some other event ( a press of key combination, or something that block the user UX )
Optional e: TPointerEventsend the mouse event that generate the finalize down, so it can be used in the event
Protected findAs opposed to findTarget we want the top most object to be returned w/o the active object cutting in line. Override at will
Optional intersecting: booleanOptional intersecting: booleanMethod that determines what object we are clicking on 11/09/2018 TODO: would be cool if findTarget could discern between being a full target or the outside part of the corner.
mouse event
the target found
Fires event with an optional options object
Event name to fire
Optional options: CanvasEvents[K]Options object
Private firePrivate
Manage the synthetic in/out events for the fabric objects on the canvas
Executes given function for each object in this group A simple shortcut for getObjects().forEach, before es6 was more complicated, now is just a shortcut.
Callback invoked with current object as first argument, index - as second and an array of all objects - as third.
Returns currently active object
active object
Returns an array with the current selected objects
active objects array
Returns instance's active selection
Returns an array of children objects of this instance
Optional Rest ...types: string[]When specified, only objects of these types are returned
Returns pointer coordinates relative to canvas. Can return coordinates with or without viewportTransform. ignoreVpt false gives back coordinates that represent the point clicked on canvas element. ignoreVpt true gives back coordinates after being processed by the viewportTransform ( sort of coordinates of what is displayed on the canvas where you are clicking. ignoreVpt true = HTMLElement coordinates relative to top,left ignoreVpt false, default = fabric space coordinates, the same used for shape position. To interact with your shapes top and left you want to use ignoreVpt false most of the time, while ignoreVpt true will give you coordinates compatible with the object.oCoords system. of the time.
Private getPrivate getPrivate handlePrivate
target selection (selects/deselects target if it isn't/is selected respectively)target from ittarget to the active selection and make it the active object.Event object
Optional target: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>target of event to select/deselect
true if grouping occurred
Protected handleruns on mouse up
Protected initRest ...objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]Returns true if object is transparent at a certain location
Clarification: this is is target transparent at location X or are controls there
Object to check
Left coordinate in viewport space
Top coordinate in viewport space
this seems dumb that we treat controls with transparency. we can find controls programmatically without painting them, the cache canvas optimization is always valid
Returns object at specified index
object at index
Populates canvas with data from the specified JSON. JSON format must conform to the one of fabric.Canvas#toJSON
IMPORTANT: It is recommended to abort loading tasks before calling this method to prevent race conditions and unnecessary networking
JSON string or object
Optional reviver: (<T>(serializedObj, instance) => void)Method for further parsing of JSON elements, called after each fabric object created.
Method for further parsing of object elements, called after each fabric object created.
Optional options: Abortable = {}options
instance
http://fabricjs.com/fabric-intro-part-3#deserialization
loadFromJSON
canvas.loadFromJSON(json).then((canvas) => canvas.requestRenderAll());
loadFromJSON with reviver
canvas.loadFromJSON(json, function(o, object) {
// `o` = json object
// `object` = fabric.Object instance
// ... do some stuff ...
}).then((canvas) => {
... canvas is restored, add your code.
});
Moves an object to specified level in stack of drawn objects
Object to send
Position to move to
true if change occurred
unsubscribe an event listener
event name (eg. 'after:render')
event listener to unsubscribe
unsubscribe event listeners
handlers key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler})
unsubscribe all event listeners
Observes specified event
Event name (eg. 'after:render')
Function that receives a notification when an event of the specified type occurs
disposer
on
Observes specified event once
Event name (eg. 'after:render')
Function that receives a notification when an event of the specified type occurs
disposer
once
Pans viewpoint relatively
(position vector) to move by
Rest ...objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]Private renderPrivate
Function created to be instance bound at initialization used in requestAnimationFrame rendering Let the fabricJS call it. If you call it manually you could have more animationFrame stacking on to of each other for an imperative rendering, use canvas.renderAll
Renders background, objects, overlay and controls.
to render
Returns pointer coordinates without the effect of the viewport Takes a point in html canvas space and gives you back a point of the scene.
with "x" and "y" number values in canvas HTML coordinates
object with "x" and "y" number values in fabricCanvas coordinates
Function used to search inside objects an object that contains pointer in bounding box or that contains pointerOnCanvas when painted
Optional objects: FabricObject<Partial<FabricObjectProps>, SerializedObjectProps, ObjectEvents>[]objects array to look into
Optional pointer: Pointx,y object of point coordinates we want to check.
top most object on screen that contains pointer
Moves an object or a selection down in stack of drawn objects
An optional parameter, intersecting allows to move the object in behind
the first intersecting object. Where intersection is calculated with
bounding box. If no intersection is found, there will not be change in the
stack.
Object to send
Optional intersecting: booleanIf true, send object behind next lower intersecting object
true if change occurred
Moves an object or the objects of a multiple selection to the bottom of the stack of drawn objects
Object to send to back
true if change occurred
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().
Property name or object (if object, iterate over the object properties)
Optional value: anyProperty value (if function, the value is passed into it and its return value is used as a new one)
Sets given object as the only active object on canvas
Object to set as an active one
Optional e: TPointerEventEvent (passed along when firing "object:selected")
true if the object has been selected
Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em)
Object with width/height properties
Optional options: TCanvasSizeOptions = {}Options object
Sets height of this canvas instance
Value to set height to
Optional options: TCanvasSizeOptions = {}Options object
will be removed in 7.0
Private setSets viewport transformation of this canvas instance
a Canvas 2D API transform matrix
Sets width of this canvas instance
Value to set width to
Optional options: TCanvasSizeOptions = {}Options object
will be removed in 7.0
Create a new HTMLCanvas element painted with the current canvas content. No need to resize the actual one or repaint it. Will transfer object ownership to a new canvas, paint it, and set everything back. This is an intermediary step used to get to a dataUrl but also it is useful to create quick image copies of a canvas without passing for the dataUrl string
Optional multiplier: number = 1a zoom factor.
Optional options: TToCanvasElementOptions<FabricObject<Partial<ObjectProps>, SerializedObjectProps, ObjectEvents>> = ...Cropping informations
Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately
Optional options: TDataUrlOptions<FabricObject<Partial<ObjectProps>, SerializedObjectProps, ObjectEvents>> = ...Options object
Returns a data: URL containing a representation of the object in the format specified by options.format
Generate jpeg dataURL with lower quality
var dataURL = canvas.toDataURL({
format: 'jpeg',
quality: 0.8
});
Generate cropped png dataURL (clipping of canvas)
var dataURL = canvas.toDataURL({
format: 'png',
left: 100,
top: 100,
width: 200,
height: 200
});
Generate double scaled png dataURL
var dataURL = canvas.toDataURL({
format: 'png',
multiplier: 2
});
Generate dataURL with objects that overlap a specified object
var myObject;
var dataURL = canvas.toDataURL({
filter: (object) => object.isContainedWithinObject(myObject) || object.intersectsWithObject(myObject)
});
Returns Object representation of canvas this alias is provided because if you call JSON.stringify on an instance, the toJSON object will be invoked if it exists. Having a toJSON method means you can do JSON.stringify(myCanvas)
JSON compatible object
http://fabricjs.com/fabric-intro-part-3#serialization
JSON without additional properties
var json = canvas.toJSON();
JSON with additional properties included
var json = canvas.toJSON(['lockMovementX', 'lockMovementY', 'lockRotation', 'lockScalingX', 'lockScalingY']);
JSON without default values
var json = canvas.toJSON();
Returns SVG representation of canvas
Optional options: TSVGExportOptions = {}Options object for SVG output
Optional reviver: TSVGReviverMethod for further parsing of svg elements, called after each fabric object converted into svg representation.
SVG string
http://fabricjs.com/fabric-intro-part-3#serialization
Normal SVG output
var svg = canvas.toSVG();
SVG output without preamble (without <?xml ../>)
var svg = canvas.toSVG({suppressPreamble: true});
SVG output with viewBox attribute
var svg = canvas.toSVG({
viewBox: {
x: 100,
y: 100,
width: 200,
height: 300
}
});
SVG output with different encoding (default: UTF-8)
var svg = canvas.toSVG({encoding: 'ISO-8859-1'});
Modify SVG output with reviver function
var svg = canvas.toSVG(null, function(svg) {
return svg.replace('stroke-dasharray: ; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; ', '');
});
Centers object vertically and horizontally in the viewport
Object to center vertically and horizontally
Centers object horizontally in the viewport, object.top is unchanged
Object to center vertically and horizontally
Centers object Vertically in the viewport, object.top is unchanged
Object to center vertically and horizontally
Sets zoom level of this canvas instance, the zoom centered around point meaning that following zoom to point with the same point will have the visual effect of the zoom originating from that point. The point won't move. It has nothing to do with canvas center or visual center of the viewport.
to zoom with respect to
to set zoom to, less than 1 zooms out
Static getGenerated using TypeDoc
During a mouse event we may need the pointer multiple times in multiple functions. _absolutePointer holds a reference to the pointer in fabricCanvas/design coordinates that is valid for the event lifespan. Every fabricJS mouse event create and delete the cache every time We do this because there are some HTML DOM inspection functions to get the actual pointer coordinates