在线工具
网站地图    收藏    合作   
<

快捷菜单 返回顶部

fabric.js中文API

fabric.js中文在线API,fabric.js中文文档API大全

Class: IText

fabric.IText

new IText() → {fabric.IText}

IText class (introduced in v1.4) Events are also fired with "text:" prefix when observing canvas. 事件也由"text:"触发。 当观察画布时前缀。
Mixes In:
Source:
See:
  • fabric.IText#initialize for constructor definition

    Supported key combinations:

      Move cursor:                    left, right, up, down
      Select character:               shift + left, shift + right
      Select text vertically:         shift + up, shift + down
      Move cursor by word:            alt + left, alt + right
      Select words:                   shift + alt + left, shift + alt + right
      Move cursor to line start/end:  cmd + left, cmd + right or home, end
      Select till start/end of line:  cmd + shift + left, cmd + shift + right or shift + home, shift + end
      Jump to start/end of text:      cmd + up, cmd + down
      Select till start/end of text:  cmd + shift + up, cmd + shift + down or shift + pgUp, shift + pgDown
      Delete character:               backspace
      Delete word:                    alt + backspace
      Delete line:                    cmd + backspace
      Forward delete:                 delete
      Copy text:                      ctrl/cmd + c
      Paste text:                     ctrl/cmd + v
      Cut text:                       ctrl/cmd + x
      Select entire text:             ctrl/cmd + a
      Quit editing                    tab or esc
    

    Supported mouse/touch combination

      Position cursor:                click/touch
      Create selection:               click/touch & drag
      Create selection:               click & shift + click
      Select word:                    double click
      Select line:                    triple click
    
Fires:
  • event:changed
  • selection:changed
  • editing:entered
  • editing:exited
Returns:
thisArg
Type
fabric.IText

Extends

Members

__charBounds

contains characters bounding boxes 包含字符和边框
Inherited From:
Source:

__corner :number|string|any

keeps the value of the last hovered corner during mouse move. 0 is no corner, or 'mt', 'ml', 'mtr' etc.. It should be private, but there is no harm in using it as a read-only property. 保持鼠标移动时最后一个悬停角的值。 0表示没有角,或者'mt', 'ml', 'mtr'等。 它应该是私人的,但是把它用作 一个只读属性。
Type:
  • number | string | any
Inherited From:
Default Value:
  • 0
Source:

_fontSizeMult :Number

Text Line proportion to font Size (in pixels) 文本行与字体的比例(像素单位)
Type:
  • Number
Inherited From:
Default Value:
  • 1.13
Source:

_measuringContext :CanvasRenderingContext2D

Reference to a context to measure text char or couple of chars the cacheContext of the canvas will be used or a freshly created one if the object is not on canvas once created it will be referenced on fabric._measuringContext to avoid creating a canvas for every text object created. 引用上下文来测量文本字符或一对字符 将使用画布的cacheContext,如果对象不在画布上,则使用新创建的cacheContext 一旦创建,它将被引用在织物上。_measuuringcontext以避免为每个 文本对象创建。
Type:
  • CanvasRenderingContext2D
Inherited From:
Source:

_styleProperties :Array

Array of properties that define a style unit (of 'styles'). 定义样式单元(“样式”)的属性数组。
Type:
  • Array
Inherited From:
Default Value:
  • ["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"]
Source:

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 只有当对象用作clipPath时才有意义。 如果为true, clipPath将有它的顶部和左侧相对于画布,并将 不受对象变换的影响。这将使clipPath成为相对的 到画布上,但只是剪切一个特定的对象。 警告:这是测试版,此功能可能会更改或重新命名。 自从测试盒框
Type:
  • boolean
Inherited From:
Default Value:
  • false
Source:

aCoords

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 useful 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 calcACoords(); 描述对象在画布对象绝对坐标中的角位置 属性是tl,tr,bl,br,并描述了四个主要角。 每个属性都是Fabric.Point的x、y、实例的对象。 坐标取决于这些属性:width, height, scaleX, scaleY skewX, skewY,角度,strokeWidth,顶部,左边。 这些坐标对于了解物体的位置很有用。他们得到更新 与oCoords,但他们不需要更新时缩放或平移变化。 坐标通过@method setcoordinates更新。 你可以计算它们不更新@method calcACoords();
Inherited From:
Source:

angle :Number

Angle of rotation of an object (in degrees) 物体的旋转角度(以度为单位)
Type:
  • Number
Inherited From:
Source:

backgroundColor :String

Background color of an object. takes css colors https://www.w3.org/TR/css-color-3/ 物体的背景颜色。 使用css颜色https://www.w3.org/TR/css-color-3/
Type:
  • String
Inherited From:
Source:

borderColor :String

Color of controlling borders of an object (when it's active) 控制对象边框的颜色(当对象处于活动状态时)
Type:
  • String
Inherited From:
Default Value:
  • rgb(178,204,255)
Source:

borderDashArray :Array

Array specifying dash pattern of an object's borders (hasBorder must be true) 指定对象边框的破折号样式的数组(hasBorder必须为true)
Type:
  • Array
Since:
  • 1.6.2
Inherited From:
Source:

borderOpacityWhenMoving :Number

Opacity of object's controlling borders when object is active and moving 当对象处于活动和移动状态时,对象控制边框的不透明度
Type:
  • Number
Inherited From:
Default Value:
  • 0.4
Source:

borderScaleFactor :Number

Scale factor of object's controlling borders bigger number will make a thicker border border is 1, so this is basically a border thickness since there is no way to change the border itself. 物体控制边界的比例因子 数字越大,边框越厚 Border是1,这就是边框的厚度 因为没有办法改变边界本身。
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

cacheProperties :Array

List of properties to consider when checking if cache needs refresh 检查缓存是否需要刷新时要考虑的属性列表
Type:
  • Array
Inherited From:
Source:

caching :Boolean

Indicates whether internal text char widths can be cached 指示是否可以缓存内部文本字符宽度
Type:
  • Boolean
Default Value:
  • true
Source:

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). 当为true时,该对象将使用中心点作为变换原点 当通过控制旋转时。 注意:此属性将替换“centerTransform”(布尔值)。
Type:
  • Boolean
Since:
  • 1.3.4
Inherited From:
Default Value:
  • true
Source:

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). 当为true时,该对象将使用中心点作为变换原点 当通过控制进行缩放时。 注意:此属性将替换“centerTransform”(布尔值)。
Type:
  • Boolean
Since:
  • 1.3.4
Inherited From:
Source:

charSpacing :Number

additional space between characters expressed in thousands of em unit 字符之间的额外空格 以千em单位表示
Type:
  • Number
Inherited From:
Source:

clipPath :fabric.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' 一个fabricObject,没有描边,用它们的形状定义一个裁剪区域。填充黑色 clipPath对象在呈现对象时被使用,上下文被放置在中间 对象cachcanvas的。 如果希望clipPath的0,0与对象中心对齐,请使用clipPath。originX / Y“中心”
Type:
Inherited From:
Source:

colorProperties :Array

List of properties to consider for animating colors. 动画颜色需要考虑的属性列表。
Type:
  • Array
Inherited From:
Source:

controls

custom controls interface controls are added by default_controls.js 自定义控件接口 通过default_controls.js添加控件
Inherited From:
Source:

cornerColor :String

Color of controlling corners of an object (when it's active) 物体控制角的颜色(当它处于活动状态时)
Type:
  • String
Inherited From:
Default Value:
  • rgb(178,204,255)
Source:

cornerDashArray :Array

Array specifying dash pattern of an object's control (hasBorder must be true) 指定对象控件的破折号样式的数组(hasBorder必须为true)
Type:
  • Array
Since:
  • 1.6.2
Inherited From:
Source:

cornerSize :Number

Size of object's controlling corners (in pixels) 对象控制角的大小(像素)
Type:
  • Number
Inherited From:
Default Value:
  • 13
Source:

cornerStrokeColor :String

Color of controlling corners of an object (when it's active and transparentCorners false) 控制对象角的颜色(当它是活动的并且transparentCorners为false时)
Type:
  • String
Since:
  • 1.6.2
Inherited From:
Source:

cornerStyle :String

Specify style of control, 'rect' or 'circle' 指定控件的样式,'rect'或'circle'
Type:
  • String
Since:
  • 1.6.2
Inherited From:
Source:

ctrlKeysMapDown

For functionalities on keyDown + ctrl || cmd 键下+ ctrl || cmd功能
Source:

ctrlKeysMapUp

For functionalities on keyUp + ctrl || cmd keyUp + ctrl || cmd的功能
Source:

cursorColor :String

Color of text cursor color in editing mode. if not set (default) will take color from the text. if set to a color value that fabric can understand, it will be used instead of the color of the text at the current position. 编辑模式下文本光标的颜色。 如果没有设置(默认)将从文本中取颜色。 如果设置一个织物可以理解的颜色值,它就会理解 用来代替当前位置的文本颜色。
Type:
  • String
Source:

cursorDelay :Number

Delay between cursor blink (in ms) 光标闪烁之间的延迟时间(毫秒)
Type:
  • Number
Default Value:
  • 1000
Source:

cursorDuration :Number

Duration of cursor fadein (in ms) 游标褪色的持续时间(毫秒)
Type:
  • Number
Default Value:
  • 600
Source:

cursorWidth :Number

Width of cursor (in px) 光标宽度(单位:px)
Type:
  • Number
Default Value:
  • 2
Source:

deltaY :Number

Baseline shift, styles only, keep at 0 for the main text object 基线移位,样式,保持为0的主要文本对象
Type:
  • Number
Inherited From:
Source:

direction :String

WARNING: EXPERIMENTAL. NOT SUPPORTED YET determine the direction of the text. This has to be set manually together with textAlign and originX for proper experience. some interesting link for the future https://www.w3.org/International/questions/qa-bidi-unicode-controls 警告:实验。还不支持 确定文本的方向。 这必须与textAlign和originX一起手动设置 体验。 未来的一些有趣的链接 https://www.w3.org/International/questions/qa-bidi-unicode-controls
Type:
  • String
Since:
  • 4.5.0
Inherited From:
Default Value:
  • ltr
Source:

dirty :Boolean

When set to `true`, object's cache will be rerendered next render call. since 1.7.0 当设置为' true '时,对象的缓存将在下一次渲染调用时被重新渲染。 自从1.7.0
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

editable :Boolean

Indicates whether a text can be edited 指示文本是否可以编辑
Type:
  • Boolean
Default Value:
  • true
Source:

editingBorderColor :String

Border color of text object while it's in editing mode 文本对象在编辑模式下的边框颜色
Type:
  • String
Default Value:
  • rgba(102,153,255,0.25)
Source:

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 当设置为' false '时,对象不能成为事件的目标。所有事件都通过它传播。介绍了v1.3.4
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

excludeFromExport :Boolean

When `true`, object is not exported in OBJECT/JSON 当' true '时,对象不会以object /JSON的形式导出
Type:
  • Boolean
Since:
  • 1.6.3
Inherited From:
Source:

fill :String

Color of object's fill takes css colors https://www.w3.org/TR/css-color-3/ 对象填充的颜色 使用css颜色https://www.w3.org/TR/css-color-3/
Type:
  • String
Inherited From:
Default Value:
  • rgb(0,0,0)
Source:

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 `fabric.Object#globalCompositeOperation` instead) 填充规则,用于填充对象 接受的值是非零的,甚至是奇数的 注意:此属性在v1.4.12之前被用于设置globalCompositeOperation(使用' fabric. net ')。对象# globalCompositeOperation '而不是)
Type:
  • String
Inherited From:
Default Value:
  • nonzero
Source:

flipX :Boolean

When true, an object is rendered as flipped horizontally 当为true时,对象被渲染为水平翻转
Type:
  • Boolean
Inherited From:
Source:

flipY :Boolean

When true, an object is rendered as flipped vertically 当为true时,对象被渲染为垂直翻转
Type:
  • Boolean
Inherited From:
Source:

fontFamily :String

Font family 字体
Type:
  • String
Inherited From:
Default Value:
  • Times New Roman
Source:

fontSize :Number

Font size (in pixels) 字体大小(像素)
Type:
  • Number
Inherited From:
Default Value:
  • 40
Source:

fontStyle :String

Font style . Possible values: "", "normal", "italic" or "oblique". 字体的风格。取值为“”、“normal”、“italic”或“indirect”。
Type:
  • String
Inherited From:
Default Value:
  • normal
Source:

fontWeight :Number|String

Font weight (e.g. bold, normal, 400, 600, 800) 字体重量(例如:粗体、普通、400、600、800)
Type:
  • Number | String
Inherited From:
Default Value:
  • normal
Source:

globalCompositeOperation :String

Composite rule used for canvas globalCompositeOperation 用于画布globalCompositeOperation的合成规则
Type:
  • String
Inherited From:
Default Value:
  • source-over
Source:

hasBorders :Boolean

When set to `false`, object's controlling borders are not rendered 当设置为' false '时,对象的控制边界不会被渲染
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

hasControls :Boolean

When set to `false`, object's controls are not displayed and can not be used to manipulate object 当设置为' false '时,对象的控件不显示,也不能用于操作对象
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

height :Number

Object height 对象的高度
Type:
  • Number
Inherited From:
Source:

hiddenTextareaContainer :HTMLElement

DOM container to append the hiddenTextarea. An alternative to attaching to the document.body. Useful to reduce laggish redraw of the full document.body tree and also with modals event capturing that won't let the textarea take focus. DOM容器中添加hiddenTextarea。 附加到document.body的替代方案。 有助于减少延迟重绘完整文档。身体树和 还有情态动词事件捕捉,不会让文本区占据焦点。
Type:
  • HTMLElement
Source:

hoverCursor :String

Default cursor value used when hovering over this object on canvas 悬停在画布上此对象上时使用的默认游标值
Type:
  • String
Inherited From:
Source:

includeDefaultValues :Boolean

When `false`, default object's values are not included in its serialization 当' false '时,默认对象的值不包含在其序列化中
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

inCompositionMode

Helps determining when the text is in composition, so that the cursor rendering is altered. 帮助确定文本在什么时候合成,以便光标 渲染是改变。
Source:

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 只有当对象用作clipPath时才有意义。 如果为true, clipPath将使对象剪辑到clipPath的外部 自从测试盒框
Type:
  • boolean
Inherited From:
Default Value:
  • false
Source:

isEditing :Boolean

Indicates whether text is in editing mode 指示文本是否处于编辑模式
Type:
  • Boolean
Source:

keysMap

For functionalities on keyDown Map a special key to a function of the instance/prototype If you need different behaviour for ESC or TAB or arrows, you have to change this map setting the name of a function that you build on the fabric.Itext or your prototype. the map change will affect all Instances unless you need for only some text Instances in that case you have to clone this object and assign your Instance. this.keysMap = fabric.util.object.clone(this.keysMap); The function must be in fabric.Itext.prototype.myFunction And will receive event as args[0] 对于键下功能 将一个特殊的键映射到实例/原型的一个函数 如果你需要ESC或TAB或箭头的不同行为,你必须改变 此映射设置在fabric上构建的函数的名称。Itext或 你的原型。 映射的改变将影响所有实例,除非你只需要一些文本实例 在这种情况下,你必须克隆这个对象并分配你的实例。 这一点。keysMap = fabric.util.object.clone (this.keysMap); 该函数必须在fabric.Itext.prototype.myFunction中,并将作为参数[0]接收事件
Source:

left :Number

Left position of an object. Note that by default it's relative to object left. You can change this by setting originX={left/center/right} 物体的左侧位置。注意,默认情况下它是相对于左对象的。您可以通过设置originX={左/中/右}来改变这一点。
Type:
  • Number
Inherited From:
Source:

lineCoords

Describe object's corner position in canvas element coordinates. includes padding. Used of object detection. set and refreshed with setCoords. 在画布元素坐标中描述对象的角位置。 包括填充。用于物体检测 设置和刷新setCoords。
Inherited From:
Source:

lineHeight :Number

Line height 行高
Type:
  • Number
Inherited From:
Default Value:
  • 1.16
Source:

linethrough :Boolean

Text decoration linethrough. 装饰linethrough文本。
Type:
  • Boolean
Inherited From:
Source:

lockMovementX :Boolean

When `true`, object horizontal movement is locked 当' true '时,对象水平移动被锁定
Type:
  • Boolean
Inherited From:
Source:

lockMovementY :Boolean

When `true`, object vertical movement is locked 当' true '时,物体垂直移动被锁定
Type:
  • Boolean
Inherited From:
Source:

lockRotation :Boolean

When `true`, object rotation is locked 当' true '时,对象旋转锁定
Type:
  • Boolean
Inherited From:
Source:

lockScalingFlip :Boolean

When `true`, object cannot be flipped by scaling into negative values 当' true '时,对象不能通过缩放到负值来翻转
Type:
  • Boolean
Inherited From:
Source:

lockScalingX :Boolean

When `true`, object horizontal scaling is locked 当' true '时,对象水平缩放被锁定
Type:
  • Boolean
Inherited From:
Source:

lockScalingY :Boolean

When `true`, object vertical scaling is locked 当' true '时,对象垂直缩放锁定
Type:
  • Boolean
Inherited From:
Source:

lockSkewingX :Boolean

When `true`, object horizontal skewing is locked 当' true '时,对象水平倾斜被锁定
Type:
  • Boolean
Inherited From:
Source:

lockSkewingY :Boolean

When `true`, object vertical skewing is locked 当' true '时,对象垂直倾斜被锁定
Type:
  • Boolean
Inherited From:
Source:

matrixCache

storage for object full transform matrix 对象满变换矩阵的存储
Inherited From:
Source:

MIN_TEXT_WIDTH :Number

contains the min text width to avoid getting 0 包含最小文本宽度以避免得到0
Type:
  • Number
Inherited From:
Default Value:
  • 2
Source:

minScaleLimit :Number

Minimum allowed scale value of an object 对象允许的最小缩放值
Type:
  • Number
Inherited From:
Source:

moveCursor :String

Default cursor value used when moving this object on canvas 在画布上移动此对象时使用的默认游标值
Type:
  • String
Inherited From:
Source:

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 当' true '时,缓存在伸缩过程中不会更新。这幅画按比例放大就会变得块状 太多,会在缩放结束时用正确的细节重新绘制。 此设置取决于性能和应用程序。 默认为true 自从1.7.0
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

objectCaching :Boolean

When `true`, object is cached on an additional canvas. When `false`, object is not cached unless necessary ( clipPath ) default to true 当' true '时,对象被缓存到额外的画布上。 当' false '时,除非必要,否则不会缓存对象(clipPath) 默认为true
Type:
  • Boolean
Since:
  • 1.7.0
Inherited From:
Default Value:
  • true
Source:

oCoords

Describe object's corner position in canvas element coordinates. properties are depending on control keys and padding 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 the controls positionHandler and are used to draw and locate controls 在画布元素坐标中描述对象的角位置。 属性取决于控制键和填充主控件。 每个属性都是一个包含x、y和corner的对象。 ' corner '属性以类似的方式包含 角落的互动区域。 坐标依赖于控件positionHandler并被使用 绘制和定位控件
Inherited From:
Source:

opacity :Number

Opacity of an object 对象的不透明度
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

originX :String

Horizontal origin of transformation of an object (one of "left", "right", "center") See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups 物体变换的横向原点(“左”、“右”、“中”之一) 参见http://jsfiddle.net/1ow02gea/244/了解originX/originY如何影响组中的对象
Type:
  • String
Inherited From:
Default Value:
  • left
Source:

originY :String

Vertical origin of transformation of an object (one of "top", "bottom", "center") See http://jsfiddle.net/1ow02gea/244/ on how originX/originY affect objects in groups 物体变换的垂直原点(“上”、“下”、“中心”之一) 参见http://jsfiddle.net/1ow02gea/244/了解originX/originY如何影响组中的对象
Type:
  • String
Inherited From:
Default Value:
  • top
Source:

overline :Boolean

Text decoration overline. 文本装饰上划线。
Type:
  • Boolean
Inherited From:
Source:

ownMatrixCache

storage for object transform matrix 对象变换矩阵的存储
Inherited From:
Source:

padding :Number

Padding between object and its controlling borders (in pixels) 对象及其控制边界之间的填充(像素单位)
Type:
  • Number
Inherited From:
Source:

paintFirst :String

Determines if the fill or the stroke is drawn first (one of "fill" or "stroke") 确定是先绘制填充还是先绘制描边("fill"或"stroke"之一)
Type:
  • String
Inherited From:
Default Value:
  • fill
Source:

path :fabric.Path

fabric.Path that the text should follow. since 4.6.0 the path will be drawn automatically. if you want to make the path visible, give it a stroke and strokeWidth or fill value if you want it to be hidden, assign visible = false to the path. This feature is in BETA, and SVG import/export is not yet supported. 织物。文本应该遵循的路径。 从4.6.0开始,路径将自动绘制。 如果你想让路径可见,给它一个stroke和strokeWidth或填充值 如果你想隐藏它,给路径赋值visible = false。 该特性处于BETA测试阶段,还不支持SVG导入/导出。
Type:
Inherited From:
Source:
Example
var textPath = new fabric.Text('Text on a path', {
    top: 150,
    left: 150,
    textAlign: 'center',
    charSpacing: -50,
    path: new fabric.Path('M 0 0 C 50 -100 150 -100 200 0', {
        strokeWidth: 1,
        visible: false
    }),
    pathSide: 'left',
    pathStartOffset: 0
});

pathAlign :String

How text is aligned to the path. This property determines the perpendicular position of each character relative to the path. (one of "baseline", "center", "ascender", "descender") This feature is in BETA, and its behavior may change 文本如何与路径对齐。这个属性决定了 每个字符相对于路径的垂直位置。 ("baseline", "center", "ascender", "descender"中的一个) 该特性处于BETA测试阶段,其行为可能会发生变化
Type:
  • String
Inherited From:
Default Value:
  • baseline
Source:

pathSide :String

Which side of the path the text should be drawn on. Only used when text has a path 文本应该画在路径的哪一边。 仅在文本有路径时使用
Type:
  • String
Inherited From:
Default Value:
  • left
Source:

pathStartOffset :Number

Offset amount for text path starting position Only used when text has a path 文本路径起始位置的偏移量 仅在文本有路径时使用
Type:
  • Number
Inherited From:
Source:

perPixelTargetFind :Boolean

When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box 当设置为“true”时,在画布上按像素“找到”对象,而不是根据边界框
Type:
  • Boolean
Inherited From:
Source:

scaleX :Number

Object scale factor (horizontal) 物体比例因子(水平)
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

scaleY :Number

Object scale factor (vertical) 物体比例因子(垂直)
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

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. 当设置为' false '时,不能选择对象进行修改(使用基于点单击的选择或基于组的选择)。 但事情还是发生了。
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

selectionBackgroundColor :String

Selection Background color of an object. colored layer behind the object when it is active. does not mix good with globalCompositeOperation methods. 选择对象的背景颜色。当对象被激活时,后面的彩色层。 不能很好地与globalCompositeOperation方法混合。
Type:
  • String
Inherited From:
Source:

selectionColor :String

Color of text selection 文本选择的颜色
Type:
  • String
Default Value:
  • rgba(17,119,255,0.3)
Source:

selectionEnd :Number

Index where text selection ends 文本选择结束的索引
Type:
  • Number
Source:

selectionStart :Number

Index where text selection starts (or where cursor is when there is no selection) 文本选择开始位置的索引(或者没有选择时光标所在位置的索引)
Type:
  • Number
Source:

shadow :fabric.Shadow

Shadow object representing shadow of this shape. Backwards incompatibility note: This property was named "textShadow" (String) until v1.2.11 表示此形状阴影的阴影对象。 注意:该属性在v1.2.11之前被命名为“textShadow”(String)
Type:
Inherited From:
Source:

skewX :Number

Angle of skew on x axes of an object (in degrees) 物体在x轴上的倾斜角(单位:度)
Type:
  • Number
Inherited From:
Source:

skewY :Number

Angle of skew on y axes of an object (in degrees) 物体在y轴上的倾斜角(单位:度)
Type:
  • Number
Inherited From:
Source:

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 当' true '时,将检查对象属性是否缓存无效。在某些特定的 你可能想要禁用的情况(喷雾刷,非常大,组) 或者如果您的应用程序不允许您修改您想要的组子的属性 为组禁用它。 缺省为false 自从1.7.0
Type:
  • Boolean
Inherited From:
Default Value:
  • false
Source:

stateProperties :Array

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 检查时要考虑的属性列表 对象的状态被改变了(fabric.Object#hasStateChanged) 以及历史(撤消/重做)的目的
Type:
  • Array
Inherited From:
Source:

stroke :String

When defined, an object is rendered via stroke and this property specifies its color. Backwards incompatibility note: This property was named "strokeStyle" until v1.1.6 定义后,对象通过描边呈现,此属性指定其颜色。 注意:此属性在v1.1.6之前被命名为“strokeStyle”
Type:
  • String
Inherited From:
Source:

strokeDashArray :Array

Array specifying dash pattern of an object's stroke (stroke must be defined) 指定对象笔画的虚线样式的数组(必须定义笔画)
Type:
  • Array
Inherited From:
Source:

strokeDashOffset :Number

Line offset of an object's stroke 物体行程的线偏移量
Type:
  • Number
Inherited From:
Source:

strokeLineCap :String

Line endings style of an object's stroke (one of "butt", "round", "square") 对象笔画的线结束样式(“屁股”、“圆”、“方”之一)
Type:
  • String
Inherited From:
Default Value:
  • butt
Source:

strokeLineJoin :String

Corner style of an object's stroke (one of "bevel", "round", "miter") 物体笔画的角型(“斜角”、“圆角”、“斜角”之一)
Type:
  • String
Inherited From:
Default Value:
  • miter
Source:

strokeMiterLimit :Number

Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke 对象笔画的最大斜接长度(用于strokeLineJoin = "miter")
Type:
  • Number
Inherited From:
Default Value:
  • 4
Source:

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. this Property does not work on Text classes or drawing call that uses strokeText,fillText methods default to false 当' false '时,斯托克宽度将随对象缩放。 当' true '时,笔画将始终匹配为笔画宽度输入的精确像素大小。 此属性不适用于使用strokeText、fillText方法的Text类或绘图调用 缺省为false
Type:
  • Boolean
Since:
  • 2.6.0
Inherited From:
Default Value:
  • false
Source:

strokeWidth :Number

Width of a stroke used to render this object 用于渲染此对象的描边宽度
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

styles :Object

Object containing character styles - top-level properties -> line numbers, 2nd-level properties - character numbers 包含字符样式的对象。顶级属性。>行号 第二级属性——字符编号
Type:
  • Object
Inherited From:
Source:

subscript :Object

Subscript schema object (minimum overlap) 下标模式对象(最小重叠)
Type:
  • Object
Inherited From:
Default Value:
  • {"size":0.6,"baseline":0.11}
Source:

superscript :Object

Superscript schema object (minimum overlap) 上标模式对象(最小重叠)
Type:
  • Object
Inherited From:
Default Value:
  • {"size":0.6,"baseline":""}
Source:

textAlign :String

Text alignment. Possible values: "left", "center", "right", "justify", "justify-left", "justify-center" or "justify-right". 文本对齐。可能的值:left, center, right, justify, "justify-left"、"justify-center"或"justify-right"。
Type:
  • String
Inherited From:
Default Value:
  • left
Source:

textBackgroundColor :String

Background color of text lines 文本行的背景颜色
Type:
  • String
Inherited From:
Source:

top :Number

Top position of an object. Note that by default it's relative to object top. You can change this by setting originY={top/center/bottom} 物体的顶部位置。注意,默认情况下它是相对于对象顶部的。你可以通过设置originY={top/center/bottom}来改变这一点。
Type:
  • Number
Inherited From:
Source:

touchCornerSize :Number

Size of object's controlling corners when touch interaction is detected 检测触摸交互时物体控制角的大小
Type:
  • Number
Inherited From:
Default Value:
  • 24
Source:

transparentCorners :Boolean

When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) 当为true时,对象的控制角在内部被渲染为透明的(即描边而不是填充)
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

type :String

Type of an object 对象的类型
Type:
  • String
Overrides:
Default Value:
  • i-text
Source:

underline :Boolean

Text decoration underline. 文本装饰突显。
Type:
  • Boolean
Inherited From:
Source:

visible :Boolean

When set to `false`, an object is not rendered on canvas 当设置为' false '时,对象不会在画布上渲染
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

width :Number

Object width 对象的宽度
Type:
  • Number
Inherited From:
Source:

Methods

(static) fromObject(object, callbackopt)

Returns fabric.IText instance from an object representation 返回织物。从对象表示的IText实例
Parameters:
Name Type Attributes Description
object Object Object to create an instance from对象来创建实例
callback function <optional>
invoked with new instance as argument用新实例作为参数调用
Source:

_calcRotateMatrix() → {Array}

calculate rotation matrix of an object 计算物体的旋转矩阵
Inherited From:
Source:
Returns:
rotation matrix for the object
Type
Array

_calcTranslateMatrix() → {Array}

calculate the translation matrix for an object transform 计算物体变换的平移矩阵
Inherited From:
Source:
Returns:
rotation matrix for the object
Type
Array

_drawClipPath(ctx, clipPath)

Prepare clipPath state and cache and draw it on instance's cache 准备clipPath状态和缓存,并在实例的缓存上绘制它
Parameters:
Name Type Description
ctx CanvasRenderingContext2D 组织类
clipPath fabric.Object 组织类
Inherited From:
Source:

_getCoords(absolute) → {Object}

return correct set of coordinates for intersection this will return either aCoords or lineCoords. 返回交点的正确坐标集 这将返回aCoords或lineCoords。
Parameters:
Name Type Description
absolute Boolean will return aCoords if true or lineCoords将返回aCoords如果为真或lineCoords
Inherited From:
Source:
Returns:
{tl, tr, br, bl} points
Type
Object

_getFontDeclaration(styleObjectopt) → {String}

return font declaration string for canvas context 返回画布上下文的字体声明字符串
Parameters:
Name Type Attributes Description
styleObject Object <optional>
object对象
Inherited From:
Source:
Returns:
font declaration formatted for canvas context.
Type
String

_getSelectionForOffset(e, isRight) → {Number}

private Helps finding if the offset should be counted from Start or End 私人 帮助查找应该从Start还是End计数偏移量
Parameters:
Name Type Description
e Event Event object事件对象
isRight Boolean 组织类
Source:
Returns:
Type
Number

_getStyleDeclaration(lineIndex, charIndex) → {Object}

get the reference, not a clone, of the style object for a given character 获取给定字符的样式对象的引用,而不是克隆
Parameters:
Name Type Description
lineIndex Number 组织类
charIndex Number 组织类
Inherited From:
Source:
Returns:
style object
Type
Object

_limitCacheSize(dims) → {Object|Object|Object|Object}

Limit the cache dimensions so that X * Y do not cross fabric.perfLimitSizeTotal and each side do not cross fabric.cacheSideLimit those numbers are configurable so that you can get as much detail as you want making bargain with performances. 限制缓存尺寸,使X * Y不会交叉。perflimitsizetotal 并且每边不交叉 这些数字是可配置的,因此您可以获得尽可能多的详细信息 与演出讨价还价。
Parameters:
Name Type Description
dims Object
Properties
Name Type Description
width Object width of canvas画布的宽度
height Object height of canvas高度的画布
zoomX Object zoomX zoom value to unscale the canvas before drawing cachezoomX缩放值在绘制缓存之前取消画布的缩放
zoomY Object zoomY zoom value to unscale the canvas before drawing cache缩放缩放值,在绘制缓存前缩放画布
属性 的名字 类型 描述 宽度 对象 画布的宽度 高度 对象 高度的画布 zoomX 对象 zoomX缩放值在绘制缓存之前取消画布的缩放 利用促镜拍摄的 对象 缩放缩放值,在绘制缓存前缩放画布
Inherited From:
Source:
Returns:
  • .width width of canvas
    Type
    Object
  • .height height of canvas
    Type
    Object
  • .zoomX zoomX zoom value to unscale the canvas before drawing cache
    Type
    Object
  • .zoomY zoomY zoom value to unscale the canvas before drawing cache
    Type
    Object

_measureLine(lineIndex) → {Object|Object}

measure every grapheme of a line, populating __charBounds 测量一行的每个字位,填充__charBounds
Parameters:
Name Type Description
lineIndex Number 组织类
Inherited From:
Source:
Returns:
  • object.width total width of characters
    Type
    Object
  • object.widthOfSpaces length of chars that match this._reSpacesAndTabs
    Type
    Object

_mouseDownHandler()

Default event handler for the basic functionalities needed on _mouseDown can be overridden to do something different. Scope of this implementation is: find the click position, set selectionStart find selectionEnd, initialize the drawing of either cursor or selection area initializing a mousedDown on a text area will cancel fabricjs knowledge of current compositionMode. It will be set to false. _mouseDown所需基本功能的默认事件处理程序 可以重写以执行不同的操作。 这个实现的范围是:找到点击位置,设置selectionStart 找到selectionEnd,初始化光标或选择区域的绘图 在文本区域上初始化一个mousedDown将取消fabricjs的知识 当前compositionMode。它将被设置为false。
Source:

_mouseDownHandlerBefore()

Default event handler for the basic functionalities needed on mousedown:before can be overridden to do something different. Scope of this implementation is: verify the object is already selected when mousing down 鼠标下拉所需的基本功能的默认事件处理程序:before 可以重写以执行不同的操作。 这个实现的范围是:当鼠标向下移动时,验证对象已经被选中
Source:

_moveCursorLeftOrRight(direction, e)

Moves cursor right or Left, fires event 向右或向左移动光标,触发事件
Parameters:
Name Type Description
direction String 'Left', 'Right'“左”、“右”
e Event Event object事件对象
Source:

_moveCursorUpOrDown(direction, e)

Moves cursor up or down, fires the events 上下移动光标,触发事件
Parameters:
Name Type Description
direction String 'Up' or 'Down'“向上”或“向下”
e Event Event object事件对象
Source:

_removeCacheCanvas()

Remove cacheCanvas and its dimensions from the objects 从对象中删除cachcanvas及其维度
Inherited From:
Source:

_renderControls(ctx, styleOverrideopt)

Renders controls and borders for the object the context here is not transformed 呈现对象的控件和边框 这里的上下文没有转换
Parameters:
Name Type Attributes Description
ctx CanvasRenderingContext2D Context to render on要呈现的上下文
styleOverride Object <optional>
properties to override the object style属性来覆盖对象样式
Inherited From:
Source:

_setupCompositeOperation(ctx)

Sets canvas globalCompositeOperation for specific object custom composition operation for the particular object can be specified using globalCompositeOperation property 为特定对象设置画布globalCompositeOperation 可以使用globalCompositeOperation属性指定特定对象的自定义合成操作
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Rendering canvas context呈现画布背景
Inherited From:
Source:

_splitTextIntoLines(text) → {Array}

Returns the text as an array of lines. 以行数组的形式返回文本。
Parameters:
Name Type Description
text String text to split文本分割
Inherited From:
Source:
Returns:
Lines in the text
Type
Array

_toSVG(reviveropt) → {String}

Returns SVG representation of an instance 返回实例的SVG表示
Parameters:
Name Type Attributes Description
reviver function <optional>
Method for further parsing of svg representation.方法用于进一步解析svg表示。
Inherited From:
Source:
Returns:
svg representation of an instance
Type
String

abortCursorAnimation()

Aborts cursor animation and clears all timeouts 中止光标动画并清除所有超时
Source:

adjustPosition(to)

Parameters:
Name Type Description
to String One of 'left', 'center', 'right'左,中,右中的一个
Inherited From:
Source:

animate(property, value) → {fabric.Object|fabric.AnimationContext|Array.<fabric.AnimationContext>}

Animates object's properties 的对象的属性
Parameters:
Name Type Description
property String | Object Property to animate (if string) or properties to animate (if object)属性动画(if string)或属性动画(if object)
value Number | Object Value to animate property to (if string was given first) or options object值将属性动画到(如果先给出字符串)或选项对象
Inherited From:
Source:
Tutorials:
Returns:
  • thisArg
    Type
    fabric.Object
  • animation context (or an array if passed multiple properties) As object — multiple properties object.animate({ left: ..., top: ... }); object.animate({ left: ..., top: ... }, { duration: ... }); As string — one property object.animate('left', ...); object.animate('left', { duration: ... });
    Type
    fabric.AnimationContext | Array.<fabric.AnimationContext>

bringForward(intersectingopt) → {fabric.Object}

Moves an object up in stack of drawn objects 在绘制对象的堆栈中向上移动对象
Parameters:
Name Type Attributes Description
intersecting Boolean <optional>
If `true`, send object in front of next upper intersecting object如果' true ',将对象发送到上一个相交对象的前面
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

bringToFront() → {fabric.Object}

Moves an object to the top of the stack of drawn objects 将对象移动到绘制对象堆栈的顶部
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

calcOwnMatrix() → {Array}

calculate transform matrix that represents the current transformations from the object's properties, this matrix does not include the group transformation 计算表示当前变换的变换矩阵 对象的属性,此矩阵不包括组转换
Inherited From:
Source:
Returns:
transform matrix for the object
Type
Array

calcTextHeight()

Calculate text box height 计算文本框的高度
Inherited From:
Source:

calcTransformMatrix(skipGroupopt) → {Array}

calculate transform matrix that represents the current transformations from the object's properties. 计算表示当前变换的变换矩阵 对象的属性。
Parameters:
Name Type Attributes Description
skipGroup Boolean <optional>
return transform matrix for object not counting parent transformations There are some situation in which this is useful to avoid the fake rotation.返回不计算父转换的对象的转换矩阵 在某些情况下,这有助于避免假旋转。
Inherited From:
Source:
Returns:
transform matrix for the object
Type
Array

center() → {fabric.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. 在最后添加的画布上垂直和水平地居中对象 你可能需要在定心后对对象调用setCoords来更新控件区域。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

centerH() → {fabric.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. 在最后添加对象的画布上水平居中。 你可能需要在定心后对对象调用setCoords来更新控件区域。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

centerV() → {fabric.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. 将对象垂直集中在最后添加到的画布上。 你可能需要在定心后对对象调用setCoords来更新控件区域。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

cleanStyle(property)

Check if characters in a text have a value for a property whose value matches the textbox's value for that property. If so, the character-level property is deleted. If the character has no other properties, then it is also deleted. Finally, if the line containing that character has no other characters then it also is deleted. 检查文本中的字符是否具有属性值 其值与该属性的文本框值匹配。如果是这样, 删除字符级属性。如果字符 没有其他属性,那么它也会被删除。最后, 如果包含该字符的行没有其他字符 然后它也被删除。
Parameters:
Name Type Description
property string The property to compare between characters and text.比较字符和文本的属性。
Inherited From:
Source:

clearContextTop()

Prepare and clean the contextTop 准备并清理contextTop
Source:

clone(callback, propertiesToIncludeopt)

Clones an instance, using a callback method will work for every object. 克隆一个实例,使用回调方法将适用于每个对象。
Parameters:
Name Type Attributes Description
callback function Callback is invoked with a clone as a first argumentCallback调用时使用克隆作为第一个参数
propertiesToInclude Array <optional>
Any properties that you might want to additionally include in the output您可能希望在输出中额外包含的任何属性
Inherited From:
Source:

cloneAsImage(callback, optionsopt) → {fabric.Object}

Creates an instance of fabric.Image out of an object makes use of toCanvasElement. Once this method was based on toDataUrl and loadImage, so it also had a quality and format option. toCanvasElement is faster and produce no loss of quality. If you need to get a real Jpeg or Png from an object, using toDataURL is the right way to do it. toCanvasElement and then toBlob from the obtained canvas is also a good option. This method is sync now, but still support the callback because we did not want to break. When fabricJS 5.0 will be planned, this will probably be changed to not have a callback. 创建fabric的实例。从对象中提取图像 使用toCanvasElement。 一旦这个方法是基于toDataUrl和loadImage,那么它也有一个质量 和格式的选择。toCanvasElement更快,而且不会产生质量损失。 如果需要从对象中获取真正的Jpeg或Png,使用toDataURL是正确的方法。 toCanvasElement和toBlob从获得的画布也是一个很好的选择。 这个方法现在是同步的,但仍然支持回调,因为我们不想中断。 在计划fabricJS 5.0时,这可能会更改为没有回调。
Parameters:
Name Type Attributes Description
callback function callback, invoked with an instance as a first argument回调,使用实例作为第一个参数调用
options Object <optional>
for clone as image, passed to toDataURL
Properties
Name Type Attributes Default Description
multiplier Number <optional>
1 Multiplier to scale by放大倍数
left Number <optional>
Cropping left offset. Introduced in v1.2.14裁剪左偏移量。介绍了v1.2.14
top Number <optional>
Cropping top offset. Introduced in v1.2.14种植前抵消。介绍了v1.2.14
width Number <optional>
Cropping width. Introduced in v1.2.14裁剪宽度。介绍了v1.2.14
height Number <optional>
Cropping height. Introduced in v1.2.14种植的高度。介绍了v1.2.14
enableRetinaScaling Boolean <optional>
Enable retina scaling for clone image. Introduce in 1.6.4为克隆图像启用视网膜缩放。在1.6.4,介绍
withoutTransform Boolean <optional>
Remove current object transform ( no scale , no angle, no flip, no skew ). Introduced in 2.3.4删除当前对象变换(无缩放、无角度、无翻转、无倾斜)。介绍了2.3.4
withoutShadow Boolean <optional>
Remove current object shadow. Introduced in 2.4.2移除当前物体阴影。在2.4.2引入
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

complexity() → {Number}

Returns complexity of an instance 返回实例的复杂度
Inherited From:
Source:
Returns:
complexity
Type
Number

containsPoint(point, linesopt, absoluteopt, calculateopt) → {Boolean}

Checks if point is inside the object 检查点是否在对象内部
Parameters:
Name Type Attributes Description
point fabric.Point Point to check against检查点
lines Object <optional>
object returned from @method _getImageLines对象从@method _getImageLines返回
absolute Boolean <optional>
use coordinates without viewportTransform使用坐标而不使用viewportTransform
calculate Boolean <optional>
use coordinates of current position instead of .oCoords使用当前位置的坐标而不是。ocoordinates
Inherited From:
Source:
Returns:
true if point is inside the object
Type
Boolean

copy(e)

Copies selected text 复制选中的文本
Parameters:
Name Type Description
e Event Event object事件对象
Source:

dispose()

cancel instance's running animations 取消实例正在运行的动画
Inherited From:
Source:

doubleClickHandler()

Default handler for double click, select a word 默认处理程序为双击,选择一个词
Source:

drawBorders(ctx, styleOverride) → {fabric.Object}

Draws borders of an object's bounding box. Requires public properties: width, height Requires public options: padding, borderColor 绘制对象的边框。 需要公共属性:宽度,高度 需要公共选项:padding, borderColor
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to draw on使用的上下文
styleOverride Object object to override the object style对象来覆盖对象样式
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

drawBordersInGroup(ctx, options, styleOverride) → {fabric.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 当对象位于组内时,绘制其边界框的边框。 需要公共属性:宽度,高度 需要公共选项:padding, borderColor
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to draw on使用的上下文
options object object representing current object parameters表示当前对象参数的对象
styleOverride Object object to override the object style对象来覆盖对象样式
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

drawCacheOnCanvas(ctx)

Paint the cached copy of the object on the target context. 在目标上下文中绘制对象的缓存副本。
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to render on要呈现的上下文
Inherited From:
Source:

drawClipPathOnCache(ctx, clipPath)

Execute the drawing operation for an object clipPath 执行对象clipPath的绘图操作
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to render on要呈现的上下文
clipPath fabric.Object 组织类
Inherited From:
Source:

drawControls(ctx, styleOverride) → {fabric.Object}

Draws corners of an object's bounding box. Requires public properties: width, height Requires public options: cornerSize, padding 绘制对象的边界框的角。 需要公共属性:宽度,高度 需要公共选项:角尺寸,填充
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to draw on使用的上下文
styleOverride Object object to override the object style对象来覆盖对象样式
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

drawObject(ctx)

Execute the drawing operation for an object on a specified context 在指定的上下文中为对象执行绘图操作
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to render on要呈现的上下文
Inherited From:
Source:

drawSelectionBackground(ctx) → {fabric.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 在对象后面的选择边框内绘制一个彩色图层。 需要公共选项:padding, selectionBackgroundColor 在转换上下文时调用此函数 当对象在staticCanvas上时,是否要跳过检查
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context to draw on使用的上下文
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

enlargeSpaces()

Enlarge space boxes and shift the others 放大空间盒子并移动其他的
Inherited From:
Source:

enterEditing() → {fabric.IText}

Enters editing state 进入编辑状态
Source:
Returns:
thisArg
Type
fabric.IText

exitEditing() → {fabric.IText}

Exits from editing state 退出编辑状态
Source:
Returns:
thisArg
Type
fabric.IText

findLineBoundaryLeft(startFrom) → {Number}

Find new selection index representing start of current line according to current selection index 根据当前选择索引,查找新的表示当前行开始的选择索引
Parameters:
Name Type Description
startFrom Number Current selection index当前选择指数
Source:
Returns:
New selection index
Type
Number

findLineBoundaryRight(startFrom) → {Number}

Find new selection index representing end of current line according to current selection index 根据当前选择指标,寻找新的表示当前行结束的选择指标
Parameters:
Name Type Description
startFrom Number Current selection index当前选择指数
Source:
Returns:
New selection index
Type
Number

findWordBoundaryLeft(startFrom) → {Number}

Find new selection index representing start of current word according to current selection index 根据当前选择索引,查找新的表示当前单词开始的选择索引
Parameters:
Name Type Description
startFrom Number Current selection index当前选择指数
Source:
Returns:
New selection index
Type
Number

findWordBoundaryRight(startFrom) → {Number}

Find new selection index representing end of current word according to current selection index 根据当前选择索引,查找新的表示当前单词结束的选择索引
Parameters:
Name Type Description
startFrom Number Current selection index当前选择指数
Source:
Returns:
New selection index
Type
Number

fire(eventName, optionsopt) → {Self}

Fires event with an optional options object 用可选的options对象触发事件
Parameters:
Name Type Attributes Description
eventName String Event name to fire要触发的事件名称
options Object <optional>
Options object选择对象
Mixes In:
Source:
Returns:
thisArg
Type
Self

forEachControl(fn)

Calls a function for each control. The function gets called, with the control, the object that is calling the iterator and the control's key 为每个控件调用函数。函数被调用, 对于控件,调用迭代器的对象和控件的键
Parameters:
Name Type Description
fn function function to iterate over the controls over函数来遍历控件
Inherited From:
Source:

fromGraphemeToStringSelection()

convert from fabric to textarea values 将织物值转换为文本区值
Source:

fromStringToGraphemeSelection()

convert from textarea to grapheme indexes 从文本区域转换到字素索引
Source:

fxStraighten(callbacks) → {fabric.Object}

Same as fabric.Object.prototype.straighten but with animation 和fabric. object .prototype.straight一样,但是带有动画
Parameters:
Name Type Description
callbacks Object Object with callback functions
Properties
Name Type Attributes Description
onComplete function <optional>
Invoked on completion上调用完成
onChange function <optional>
Invoked on every step of animation在动画的每一步上调用
带有回调函数的 属性 的名字 类型 属性 描述 onComplete 函数 上调用完成 onChange 函数 在动画的每一步调用
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

get2DCursorLocation(selectionStartopt, skipWrappingopt)

Returns 2d representation (lineIndex and charIndex) of cursor (or selection start) 返回游标(或选择开始)的2d表示(lineIndex和charIndex)
Parameters:
Name Type Attributes Description
selectionStart Number <optional>
Optional index. When not given, current selectionStart is used.可选的指数。如果没有给出,则使用current selectionStart。
skipWrapping Boolean <optional>
consider the location for unwrapped lines. useful to manage styles.考虑未换行的位置。管理样式很有用。
Inherited From:
Source:

getBoundingRect(absoluteopt, calculateopt) → {Object}

Returns coordinates of object's bounding rectangle (left, top, width, height) the box is intended as aligned to axis of canvas. 返回对象的边界矩形(左,上,宽,高)的坐标 盒子要与画布轴对齐。
Parameters:
Name Type Attributes Description
absolute Boolean <optional>
use coordinates without viewportTransform使用坐标而不使用viewportTransform
calculate Boolean <optional>
use coordinates of current position instead of .oCoords / .aCoords使用当前位置的坐标,而不是.oCoords / .aCoords
Inherited From:
Source:
Returns:
Object with left, top, width, height properties
Type
Object

getCenterPoint() → {fabric.Point}

Returns the real center coordinates of the object 返回对象的真实中心坐标
Inherited From:
Source:
Returns:
Type
fabric.Point

getCompleteStyleDeclaration(lineIndex, charIndex) → {Object}

return a new object that contains all the style property for a character the object returned is newly created 返回一个包含字符所有样式属性的新对象 返回的对象是新创建的
Parameters:
Name Type Description
lineIndex Number of the line where the character is字符所在的行
charIndex Number position of the character on the line字符在行上的位置
Inherited From:
Source:
Returns:
style object
Type
Object

getCoords() → {Array}

return correct set of coordinates for intersection this will return either aCoords or lineCoords. The coords are returned in an array. 返回交点的正确坐标集 这将返回aCoords或lineCoords。 这些坐标以数组的形式返回。
Inherited From:
Source:
Returns:
[tl, tr, br, bl] of points
Type
Array

getCurrentCharColor() → {String|fabric.Gradient|fabric.Pattern}

High level function to know the color of the cursor. the currentChar is the one that precedes the cursor Returns color (fill) of char at the current cursor if the text object has a pattern or gradient for filler, it will return that. Unused by the library, is for the end user 高级功能,知道光标的颜色。 currentChar是光标前面的那个 返回当前光标处char的颜色(填充) 如果文本对象有填充的模式或渐变,它将返回该填充。 库未使用的,是给最终用户的
Source:
Returns:
Character color (fill)
Type
String | fabric.Gradient | fabric.Pattern

getCurrentCharFontSize() → {Number}

High level function to know the height of the cursor. the currentChar is the one that precedes the cursor Returns fontSize of char at the current cursor Unused from the library, is for the end user 高级函数,知道光标的高度。 currentChar是光标前面的那个 返回当前光标处char的fontSize 未使用的从库,是为最终用户
Source:
Returns:
Character font size
Type
Number

getDownCursorOffset(e, isRight) → {Number}

Gets start offset of a selection 获取选定对象的起始偏移量
Parameters:
Name Type Description
e Event Event object事件对象
isRight Boolean 组织类
Source:
Returns:
Type
Number

getHeightOfChar(line, _char) → {Number}

Computes height of character at given position 计算字符在给定位置的高度
Parameters:
Name Type Description
line Number the line index number行索引号
_char Number the character index number字符索引号
Inherited From:
Source:
Returns:
fontSize of the character
Type
Number

getHeightOfLine(lineIndex) → {Number}

Calculate height of line at 'lineIndex' 计算lineIndex处的线的高度
Parameters:
Name Type Description
lineIndex Number index of line to calculate要计算的行索引
Inherited From:
Source:
Returns:
Type
Number

getLocalPointer(e, pointeropt) → {Object}

Returns coordinates of a pointer relative to an object 返回指针相对于对象的坐标
Parameters:
Name Type Attributes Description
e Event Event to operate upon要操作的事件
pointer Object <optional>
Pointer to operate upon (instead of event)要操作的指针(而不是事件)
Inherited From:
Source:
Returns:
Coordinates of a pointer (x, y)
Type
Object

getObjectOpacity() → {Number}

Return the object opacity counting also the group property 返回对象不透明度计数和组属性
Inherited From:
Source:
Returns:
Type
Number

getObjectScaling() → {Object}

Return the object scale factor counting also the group scaling 返回对象缩放因子计数和组缩放
Inherited From:
Source:
Returns:
object with scaleX and scaleY properties
Type
Object

getPointByOrigin(originX, originY) → {fabric.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'垂直原点:“顶部”、“中心”或“底部”
Inherited From:
Source:
Returns:
Type
fabric.Point

getScaledHeight() → {Number}

Returns height of an object bounding box counting transformations before 2.0 it was named getHeight(); 返回对象边界框计数转换的高度 在2.0之前,它被命名为getHeight();
Inherited From:
Source:
Returns:
height value
Type
Number

getScaledWidth() → {Number}

Returns width of an object's bounding box counting transformations before 2.0 it was named getWidth(); 返回对象的边界框计数转换的宽度 在2.0之前,它被命名为getWidth();
Inherited From:
Source:
Returns:
width value
Type
Number

getSelectedText() → {String}

Returns selected text 返回选中的文本
Source:
Returns:
Type
String

getSelectionStartFromPointer(e) → {Number}

Returns index of a character corresponding to where an object was clicked 返回与单击对象的位置对应的字符索引
Parameters:
Name Type Description
e Event Event object事件对象
Source:
Returns:
Index of a character
Type
Number

getSelectionStyles(startIndexopt, endIndexopt, completeopt) → {Array}

Gets style of a current selection/cursor (at the start position) if startIndex or endIndex are not provided, selectionStart or selectionEnd will be used. 获取当前选择项/游标(在起始位置)的样式。 如果没有提供startIndex或endIndex,则将使用selectionStart或selectionEnd。
Parameters:
Name Type Attributes Description
startIndex Number <optional>
Start index to get styles at开始索引获得样式在
endIndex Number <optional>
End index to get styles at, if not specified selectionEnd or startIndex + 1如果没有指定selectionEnd或startIndex + 1,则结束索引以获取样式
complete Boolean <optional>
get full style or not穿不穿全款
Inherited From:
Source:
Returns:
styles an array with one, zero or more Style objects
Type
Array

getSvgCommons() → {String}

Returns id attribute for svg output 返回svg输出的id属性
Inherited From:
Source:
Returns:
Type
String

getSvgFilter() → {String}

Returns filter for svg shadow 返回svg阴影的过滤器
Inherited From:
Source:
Returns:
Type
String

getSvgSpanStyles(style, useWhiteSpace) → {String}

Returns styles-string for svg-export 返回svg-export的样式字符串
Parameters:
Name Type Description
style Object the object from which to retrieve style properties要从中检索样式属性的对象
useWhiteSpace Boolean a boolean to include an additional attribute in the style.在样式中包含额外属性的布尔值。
Inherited From:
Source:
Returns:
Type
String

getSvgStyles(skipShadow) → {String}

Returns styles-string for svg-export 返回svg-export的样式字符串
Parameters:
Name Type Description
skipShadow Boolean a boolean to skip shadow filter output用于跳过阴影过滤器输出的布尔值
Inherited From:
Source:
Returns:
Type
String

getSvgTextDecoration(style) → {String}

Returns text-decoration property for svg-export 返回svg-export的文本装饰属性
Parameters:
Name Type Description
style Object the object from which to retrieve style properties要从中检索样式属性的对象
Inherited From:
Source:
Returns:
Type
String

getSvgTransform(use) → {String}

Returns transform-string for svg-export 返回用于svg-export的transform-string
Parameters:
Name Type Description
use Boolean the full transform or the single object one.完整的变换或者单个物体的变换。
Inherited From:
Source:
Returns:
Type
String

getTotalObjectScaling() → {Object}

Return the object scale factor counting also the group scaling, zoom and retina 返回对象缩放因子计数,还包括组缩放、缩放和视网膜
Inherited From:
Source:
Returns:
object with scaleX and scaleY properties
Type
Object

getUpCursorOffset(e, isRight) → {Number}

Parameters:
Name Type Description
e Event Event object事件对象
isRight Boolean 组织类
Source:
Returns:
Type
Number

getValueOfPropertyAt(lineIndex, charIndex, property)

Retrieves the value of property at given character position 在给定字符位置处检索属性的值
Parameters:
Name Type Description
lineIndex Number the line number行号
charIndex Number the character number字符数
property String the property name属性名
Inherited From:
Source:
Returns:
the value of 'property'

getViewportTransform() → {Array}

Retrieves viewportTransform from Object's canvas if possible 如果可能的话,从对象的画布中检索viewportTransform
Inherited From:
Source:
Returns:
Type
Array

hasFill()

return true if the object will draw a fill Does not consider text styles. This is just a shortcut used at rendering time We want it to be an approximation and be fast. wrote to avoid extra caching, it has to return true when fill happens, can guess when it will not happen at 100% chance, does not matter if it misses some use case where the fill is invisible. 如果对象将绘制填充,则返回true 不考虑文本样式。这只是在渲染时使用的一个快捷方式 我们希望它是一个近似值,而且要快。 为了避免额外的缓存,它必须在填充发生时返回true, 能猜出它什么时候不会发生的几率是100%吗,错过了也没关系吗 在一些用例中填充是不可见的。
Since:
  • 3.0.0
Inherited From:
Source:
Returns:
Boolean

hasStateChanged(propertySetopt) → {Boolean}

Returns true if object state (one of its state properties) was changed 如果对象状态(它的一个状态属性)被更改,则返回true
Parameters:
Name Type Attributes Description
propertySet String <optional>
optional name for the set of property we want to save要保存的属性集的可选名称
Inherited From:
Source:
Returns:
true if instance' state has changed since `fabric.Object#saveState` was called
Type
Boolean

hasStroke()

return true if the object will draw a stroke Does not consider text styles. This is just a shortcut used at rendering time We want it to be an approximation and be fast. wrote to avoid extra caching, it has to return true when stroke happens, can guess when it will not happen at 100% chance, does not matter if it misses some use case where the stroke is invisible. 如果对象将绘制笔画,则返回true 不考虑文本样式。这只是在渲染时使用的一个快捷方式 我们希望它是一个近似值,而且要快。 为了避免额外的缓存,它必须在stroke发生时返回true, 能猜出它什么时候不会发生的几率是100%吗,错过了也没关系吗 在一些用例中,笔画是不可见的。
Since:
  • 3.0.0
Inherited From:
Source:
Returns:
Boolean

initAddedHandler()

Initializes "added" event handler 初始化“已添加”事件处理程序
Source:

initBehavior()

Initializes all the interactive behavior of IText 初始化IText的所有交互行为
Source:

initClicks()

Initializes double and triple click event handlers 初始化双击和三重单击事件处理程序
Source:

initCursorSelectionHandlers()

Initializes event handlers related to cursor or selection 初始化与游标或选择相关的事件处理程序
Source:

initDelayedCursor()

Initializes delayed cursor 延迟初始化指针
Source:

initDoubleClickSimulation()

Initializes "dbclick" event handler 初始化“dbclick”事件处理程序
Source:

initHiddenTextarea()

Initializes hidden textarea (needed to bring up keyboard in iOS) 初始化隐藏文本区(需要在iOS中打开键盘)
Source:

initialize(text, optionsopt) → {fabric.IText}

Constructor 构造函数
Parameters:
Name Type Attributes Description
text String Text string文本字符串
options Object <optional>
Options object选择对象
Overrides:
Source:
Returns:
thisArg
Type
fabric.IText

initMousedownHandler()

Initializes "mousedown" event handler 初始化"mousedown"事件处理程序
Source:

initMouseMoveHandler()

Initializes "mousemove" event handler 初始化"mousemove"事件处理程序
Source:

initMouseupHandler()

Initializes "mouseup" event handler 初始化"mouseup"事件处理程序
Source:

insertChars(text, style, start, end)

insert characters at start position, before start position. start equal 1 it means the text get inserted between actual grapheme 0 and 1 if style array is provided, it must be as the same length of text in graphemes if end is provided and is bigger than start, old text is replaced. start/end ar per grapheme position in _text array. 在开始位置之前插入字符。 Start = 1表示文本插入到实际的字素0和1之间 如果提供了样式数组,则必须与以字素为单位的文本长度相同 如果提供了end且大于start,则替换旧文本。 在_text数组中的每个字位开始/结束ar。
Parameters:
Name Type Description
text String text to insert文本插入
style Array array of style objects样式对象数组
start Number 组织类
end Number default to start + 1默认开始+ 1
Source:

insertCharStyleObject(lineIndex, charIndex, quantity, copiedStyle)

Inserts style object for a given line/char index 为给定的行/字符索引插入样式对象
Parameters:
Name Type Description
lineIndex Number Index of a line行索引
charIndex Number Index of a charchar类型的索引
quantity Number number Style object to insert, if given如果给定要插入的样式对象
copiedStyle Array array of style objects样式对象数组
Source:

insertNewlineStyleObject(lineIndex, charIndex, qty, copiedStyle)

Handle insertion of more consecutive style lines for when one or more newlines gets added to the text. Since current style needs to be shifted first we shift the current style of the number lines needed, then we add new lines from the last to the first. 处理插入更多连续样式行,当一个或多个 换行符被添加到文本中。因为现在的风格需要改变 首先,我们移动所需数轴的当前样式,然后进行相加 从最后一句到第一句的新台词。
Parameters:
Name Type Description
lineIndex Number Index of a line行索引
charIndex Number Index of a charchar类型的索引
qty Number number of lines to add要添加的行数
copiedStyle Array Array of objects styles对象样式数组
Source:

insertNewStyleBlock(insertedText, start, copiedStyleopt)

Inserts style object(s) 插入样式对象(年代)
Parameters:
Name Type Attributes Description
insertedText Array Characters at the location where style is inserted插入样式位置的字符
start Number cursor index for inserting style用于插入样式的游标索引
copiedStyle Array <optional>
array of style objects to insert.要插入的样式对象数组。
Source:

intersectsWithObject(other, absoluteopt, calculateopt) → {Boolean}

Checks if object intersects with another object 检查对象是否与另一个对象相交
Parameters:
Name Type Attributes Description
other Object Object to test对象来测试
absolute Boolean <optional>
use coordinates without viewportTransform使用坐标而不使用viewportTransform
calculate Boolean <optional>
use coordinates of current position instead of .oCoords使用当前位置的坐标而不是。ocoordinates
Inherited From:
Source:
Returns:
true if object intersects with another object
Type
Boolean

intersectsWithRect(pointTL, pointBR, absoluteopt, calculateopt) → {Boolean}

Checks if object intersects with an area formed by 2 points 检查物体是否与2点组成的区域相交
Parameters:
Name Type Attributes Description
pointTL Object top-left point of area区域的左上角
pointBR Object bottom-right point of area右下角的区域
absolute Boolean <optional>
use coordinates without viewportTransform使用坐标而不使用viewportTransform
calculate Boolean <optional>
use coordinates of current position instead of .oCoords使用当前位置的坐标而不是。ocoordinates
Inherited From:
Source:
Returns:
true if object intersects with an area formed by 2 points
Type
Boolean

isCacheDirty(skipCanvas)

Check if cache is dirty 检查缓存是否脏
Parameters:
Name Type Description
skipCanvas Boolean skip canvas checks because this object is painted on parent canvas.跳过画布检查,因为此对象已被绘制 父画布上。
Inherited From:
Source:

isContainedWithinObject(other, absoluteopt, calculateopt) → {Boolean}

Checks if object is fully contained within area of another object 检查对象是否完全包含在另一个对象的区域内
Parameters:
Name Type Attributes Description
other Object Object to test对象来测试
absolute Boolean <optional>
use coordinates without viewportTransform使用坐标而不使用viewportTransform
calculate Boolean <optional>
use coordinates of current position instead of .oCoords使用当前位置的坐标而不是。ocoordinates
Inherited From:
Source:
Returns:
true if object is fully contained within area of another object
Type
Boolean

isContainedWithinRect(pointTL, pointBR, absoluteopt, calculateopt) → {Boolean}

Checks if object is fully contained within area formed by 2 points 检查对象是否完全包含在由2点组成的区域内
Parameters:
Name Type Attributes Description
pointTL Object top-left point of area区域的左上角
pointBR Object bottom-right point of area右下角的区域
absolute Boolean <optional>
use coordinates without viewportTransform使用坐标而不使用viewportTransform
calculate Boolean <optional>
use coordinates of current position instead of .oCoords使用当前位置的坐标而不是。ocoordinates
Inherited From:
Source:
Returns:
true if object is fully contained within area formed by 2 points
Type
Boolean

isControlVisible(controlKey) → {Boolean}

Returns true if the specified control is visible, false otherwise. 如果指定的控件是可见的则返回true,否则返回false。
Parameters:
Name Type Description
controlKey String The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.控制键。可能的值是“tl”,“tr”,“品牌”,“提单”、“毫升”、“太”,“先生”,“m”,“地铁”。
Inherited From:
Source:
Returns:
true if the specified control is visible, false otherwise
Type
Boolean

isEmptyStyles(lineIndex) → {Boolean}

Returns true if object has no styling or no styling in a line 如果对象没有样式或在一行中没有样式,则返回true
Parameters:
Name Type Description
lineIndex Number , lineIndex is on wrapped lines., lineIndex位于换行行上。
Inherited From:
Source:
Returns:
Type
Boolean

isEndOfWrapping() → {Boolean}

Detect if the text line is ended with an hard break text and itext do not have wrapping, return false 检测文本行是否以硬断符结束 Text和itext没有换行,返回false
Inherited From:
Source:
Returns:
Type
Boolean

isOnScreen(calculateopt) → {Boolean}

Checks if object is contained within the canvas with current viewportTransform the check is done stopping at first point that appears on screen 使用当前viewportTransform检查对象是否包含在画布中 检查在屏幕上出现的第一个点停止
Parameters:
Name Type Attributes Description
calculate Boolean <optional>
use coordinates of current position instead of .aCoords使用当前位置的坐标而不是。acoords
Inherited From:
Source:
Returns:
true if object is fully or partially contained within canvas
Type
Boolean

isPartiallyOnScreen(calculateopt) → {Boolean}

Checks if object is partially contained within the canvas with current viewportTransform 使用当前viewportTransform检查对象是否部分包含在画布中
Parameters:
Name Type Attributes Description
calculate Boolean <optional>
use coordinates of current position instead of .oCoords使用当前位置的坐标而不是。ocoordinates
Inherited From:
Source:
Returns:
true if object is partially contained within canvas
Type
Boolean

isType(type) → {Boolean}

Returns true if specified type is identical to the type of an instance 如果指定的类型与实例的类型相同,则返回true
Parameters:
Name Type Description
type String Type to check against键入以进行检查
Inherited From:
Source:
Returns:
Type
Boolean

measureLine(lineIndex) → {Number}

measure a text line measuring all characters. 测量测量所有字符的文本行。
Parameters:
Name Type Description
lineIndex Number line number行号
Inherited From:
Source:
Returns:
Line width
Type
Number

missingNewlineOffset()

Detect if a line has a linebreak and so we need to account for it when moving and counting style. It return always for text and Itext. 检测一行是否有换行,所以我们需要在移动时考虑到它 和计算方式。 它总是为text和Itext返回。
Inherited From:
Source:
Returns:
Number

moveCursorDown(e)

Moves cursor down 移动光标向下
Parameters:
Name Type Description
e Event Event object事件对象
Source:

moveCursorLeft(e)

Moves cursor left 移动光标离开
Parameters:
Name Type Description
e Event Event object事件对象
Source:

moveCursorLeftWithoutShift(e)

Moves cursor left without keeping selection 将光标向左移动,但不保留选择
Parameters:
Name Type Description
e Event 组织类
Source:

moveCursorLeftWithShift(e)

Moves cursor left while keeping selection 将光标向左移动,同时保持选定
Parameters:
Name Type Description
e Event 组织类
Source:

moveCursorRight(e)

Moves cursor right 移动光标右
Parameters:
Name Type Description
e Event Event object事件对象
Source:

moveCursorRightWithoutShift(e)

Moves cursor right without keeping selection 向右移动光标而不保持选定
Parameters:
Name Type Description
e Event Event object事件对象
Source:

moveCursorRightWithShift(e)

Moves cursor right while keeping selection 在保持选择的同时向右移动光标
Parameters:
Name Type Description
e Event 组织类
Source:

moveCursorUp(e)

Moves cursor up 移动光标到
Parameters:
Name Type Description
e Event Event object事件对象
Source:

moveCursorWithoutShift(offset)

Moves cursor up without shift 不移位地向上移动光标
Parameters:
Name Type Description
offset Number 组织类
Source:

moveCursorWithShift(offset)

Moves cursor with shift 用shift移动光标
Parameters:
Name Type Description
offset Number 组织类
Source:

moveTo(index) → {fabric.Object}

Moves an object to specified level in stack of drawn objects 将对象移动到绘制对象堆栈中的指定级别
Parameters:
Name Type Description
index Number New position of object物体的新位置
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

needsItsOwnCache()

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 当设置为' true '时,强制对象拥有自己的缓存,即使它在组中 当你的对象在缓存上以一种特定的方式运行时,可能需要它,并且总是需要它 它自己的独立画布来正确渲染。 创建以被覆盖 自从1.7.12
Inherited From:
Source:
Returns:
Boolean

onCompositionEnd()

Composition end 作文结束
Source:

onCompositionStart()

Composition start 作文开始
Source:

onDeselect(optionsopt)

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 这个回调函数在每次_discardActiveObject或_setActiveObject时被调用 尝试取消选择此对象。如果函数返回true,则取消进程
Parameters:
Name Type Attributes Description
options Object <optional>
options sent from the upper functions
Properties
Name Type Attributes Description
e Event <optional>
event if the process is generated by an event事件,如果流程是由事件生成的
从上层功能发送的选项 属性 的名字 类型 属性 描述 e 事件 事件,如果流程是由事件生成的
Overrides:
Source:

onInput(e)

Handles onInput event 处理onInput事件
Parameters:
Name Type Description
e Event Event object事件对象
Source:

onKeyDown(e)

Handles keydown event only used for arrows and combination of modifier keys. 处理keydown事件 只用于箭头和修饰键的组合。
Parameters:
Name Type Description
e Event Event object事件对象
Source:

onKeyUp(e)

Handles keyup event We handle KeyUp because ie11 and edge have difficulties copy/pasting if a copy/cut event fired, keyup is dismissed 处理按键弹起事件 我们处理KeyUp因为ie11和edge有困难复制/粘贴 如果复制/剪切事件被触发,keyup将被解散
Parameters:
Name Type Description
e Event Event object事件对象
Source:

onSelect(optionsopt)

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 这个回调函数在每次_discardActiveObject或_setActiveObject时被调用 尝试选择此对象。如果函数返回true,则取消进程
Parameters:
Name Type Attributes Description
options Object <optional>
options sent from the upper functions
Properties
Name Type Attributes Description
e Event <optional>
event if the process is generated by an event事件,如果流程是由事件生成的
从上层功能发送的选项 属性 的名字 类型 属性 描述 e 事件 事件,如果流程是由事件生成的
Inherited From:
Source:

paste(e)

Pastes text 粘贴文本
Parameters:
Name Type Description
e Event Event object事件对象
Source:

removeChars(start, end)

Removes characters from start/end start/end ar per grapheme position in _text array. 从开始/结束位置删除字符 在_text数组中的每个字位开始/结束ar。
Parameters:
Name Type Description
start Number 组织类
end Number default to start + 1默认开始+ 1
Source:

removeStyle(props)

Remove a style property or properties from all individual character styles in a text object. Deletes the character style object if it contains no other style props. Deletes a line style object if it contains no other character styles. 从所有单个字符样式中删除一个或多个样式属性 在文本对象中。如果不包含其他样式,则删除字符样式对象 道具。如果该行样式对象不包含其他字符样式,则删除该行样式对象。
Parameters:
Name Type Description
props String The property to remove from character styles.要从字符样式中删除的属性。
Inherited From:
Source:

removeStyleFromTo(start, end)

remove and reflow a style block from start to end. 从头到尾拆卸并回流样式块。
Parameters:
Name Type Description
start Number linear start position for removal (included in removal)移动的线性起始位置(包含在移动中)
end Number linear end position for removal ( excluded from removal )可拆卸的线性末端位置(不包括在拆卸范围内)
Source:

renderCursor(boundaries, ctx)

Renders cursor 使光标
Parameters:
Name Type Description
boundaries Object 组织类
ctx CanvasRenderingContext2D transformed context to draw on转换上下文来借鉴
Source:

renderCursorOrSelection()

Renders cursor or selection (depending on what exists) it does on the contextTop. If contextTop is not available, do nothing. 呈现光标或选区(取决于存在的内容) 它是在contextTop上。如果contextTop不可用,什么也不做。
Source:

renderSelection(boundaries, ctx)

Renders text selection 呈现文本的选择
Parameters:
Name Type Description
boundaries Object Object with left/top/leftOffset/topOffset对象的左/上/ leftOffset / topOffset
ctx CanvasRenderingContext2D transformed context to draw on转换上下文来借鉴
Source:

rotate(angle) → {fabric.Object}

Sets "angle" of an instance with centered rotation 设置实例的“角度”,以居中旋转
Parameters:
Name Type Description
angle Number Angle value (in degrees)角度值(以度为单位)
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

saveState(optionsopt) → {fabric.Object}

Saves state of an object 保存对象的状态
Parameters:
Name Type Attributes Description
options Object <optional>
Object with additional `stateProperties` array to include when saving state对象,该对象具有在保存状态时要包含的附加' stateProperties '数组
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

scale(value) → {fabric.Object}

Scales an object (equally by x and y) 缩放对象(x和y相等)
Parameters:
Name Type Description
value Number Scale factor比例因子
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

scaleToHeight(value, absolute) → {fabric.Object}

Scales an object to a given height, with respect to bounding box (scaling by x/y equally) 根据边界框将对象缩放到给定的高度(相等地按x/y缩放)
Parameters:
Name Type Description
value Number New height value新的高度值
absolute Boolean ignore viewport忽略视窗
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

scaleToWidth(value, absolute) → {fabric.Object}

Scales an object to a given width, with respect to bounding box (scaling by x/y equally) 根据边框将对象缩放到给定的宽度(相等地按x/y缩放)
Parameters:
Name Type Description
value Number New width value新的宽度值
absolute Boolean ignore viewport忽略视窗
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

searchWordBoundary(selectionStart, direction) → {Number}

Finds index corresponding to beginning or end of a word 查找单词的开头或结尾对应的索引
Parameters:
Name Type Description
selectionStart Number Index of a character字符索引
direction Number 1 or -11或1
Source:
Returns:
Index of the beginning or end of a word
Type
Number

selectAll() → {fabric.IText}

Selects entire text 选择所有文本
Source:
Returns:
thisArg
Type
fabric.IText

selectLine(selectionStart) → {fabric.IText}

Selects a line based on the index 根据索引选择一行
Parameters:
Name Type Description
selectionStart Number Index of a character字符索引
Source:
Returns:
thisArg
Type
fabric.IText

selectWord(selectionStart)

Selects a word based on the index 根据索引选择一个单词
Parameters:
Name Type Description
selectionStart Number Index of a character字符索引
Source:

sendBackwards(intersectingopt) → {fabric.Object}

Moves an object down in stack of drawn objects 在绘制对象的堆栈中向下移动对象
Parameters:
Name Type Attributes Description
intersecting Boolean <optional>
If `true`, send object behind next lower intersecting object如果' true ',则将对象发送到下一个相交对象的后面
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

sendToBack() → {fabric.Object}

Moves an object to the bottom of the stack of drawn objects 将对象移动到绘制对象堆栈的底部
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

set(key, value) → {fabric.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()`. 将属性设置为给定值。当更改位置/尺寸相关属性(左、上、比例、角度等)时' set '不会更新对象的边框/控件的位置。如果你需要更新这些,调用' setCoords() '。
Parameters:
Name Type Description
key String | Object Property name or object (if object, iterate over the object properties)属性名或对象(如果是object,则遍历对象属性)
value Object | function Property value (if function, the value is passed into it and its return value is used as a new one)属性值(if函数,该值被传递给它,它的返回值被用作一个新的值)
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

setControlsVisibility(optionsopt) → {fabric.Object}

Sets the visibility state of object controls. 设置对象控件的可见性状态。
Parameters:
Name Type Attributes Description
options Object <optional>
Options object
Properties
Name Type Attributes Description
bl Boolean <optional>
true to enable the bottom-left control, false to disable itTrue表示启用左下角的控件,false表示禁用该控件
br Boolean <optional>
true to enable the bottom-right control, false to disable itTrue表示启用右下角的控件,false表示禁用该控件
mb Boolean <optional>
true to enable the middle-bottom control, false to disable itTrue为启用中底控件,false为禁用该控件
ml Boolean <optional>
true to enable the middle-left control, false to disable itTrue表示启用左中间的控件,false表示禁用该控件
mr Boolean <optional>
true to enable the middle-right control, false to disable itTrue为启用右中间的控件,false为禁用该控件
mt Boolean <optional>
true to enable the middle-top control, false to disable itTrue为启用中顶控件,false为禁用该控件
tl Boolean <optional>
true to enable the top-left control, false to disable itTrue表示启用左上角的控件,false表示禁用该控件
tr Boolean <optional>
true to enable the top-right control, false to disable itTrue为启用右上角的控件,false为禁用该控件
mtr Boolean <optional>
true to enable the middle-top-rotate control, false to disable itTrue表示启用中顶旋转控制,false表示禁用
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

setControlVisible(controlKey, visible) → {fabric.Object}

Sets the visibility of the specified control. 设置指定控件的可见性。
Parameters:
Name Type Description
controlKey String The key of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'.控制键。可能的值是“tl”,“tr”,“品牌”,“提单”、“毫升”、“太”,“先生”,“m”,“地铁”。
visible Boolean true to set the specified control visible, false otherwise设置指定的控件为True,否则为false
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

setCoords(skipCornersopt) → {fabric.Object}

Sets corner and controls position coordinates based on current angle, width and height, left and top. 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 https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords and http://fabricjs.com/fabric-gotchas 设置角并基于当前角度、宽度和高度、左侧和顶部控制位置坐标。 oCoords是用来找到角落的 aCoords用于在画布上快速查找对象 lineCoords用于在指针事件期间快速查找对象。 参见https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords和http://fabricjs.com/fabric-gotchas
Parameters:
Name Type Attributes Description
skipCorners Boolean <optional>
skip calculation of oCoords.跳过oCoords的计算。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

setCursorByClick(e)

Changes cursor location in a text depending on passed pointer (x/y) object 根据传递的指针(x/y)对象更改文本中的光标位置
Parameters:
Name Type Description
e Event Event object事件对象
Source:

setOnGroup()

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. 这个回调函数由对象的父组调用 更改组上的非委托属性的时间。它被传递了密钥 值作为参数。没有添加此函数的签名以避免 关于未使用变量的Travis构建错误。
Inherited From:
Source:

setOptions(optionsopt)

Sets object's properties from options 从选项设置对象的属性
Parameters:
Name Type Attributes Description
options Object <optional>
Options object选择对象
Inherited From:
Source:

setPathInfo() → {fabric.Text}

If text has a path, it will add the extra information needed for path and text calculations 如果文本有路径,它将添加所需的额外信息 用于路径和文本计算
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Text

setPositionByOrigin(pos, originX, originY) → {void}

Sets the position of the object taking into consideration the object's origin 考虑到对象的原点,设置对象的位置
Parameters:
Name Type Description
pos fabric.Point The new position of the object对象的新位置
originX String Horizontal origin: 'left', 'center' or 'right'水平原点:“左”、“中”或“右”
originY String Vertical origin: 'top', 'center' or 'bottom'垂直原点:“顶部”、“中心”或“底部”
Inherited From:
Source:
Returns:
Type
void

setSelectionEnd(index)

Sets selection end (right boundary of a selection) 设置选择结束(选择的右边界)
Parameters:
Name Type Description
index Number Index to set selection end to要设置选择结束的索引
Source:

setSelectionStart(index)

Sets selection start (left boundary of a selection) 设置选区开始(选区的左边界)
Parameters:
Name Type Description
index Number Index to set selection start to要设置选择开始的索引
Source:

setSelectionStartEndWithShift()

Set the selectionStart and selectionEnd according to the new position of cursor mimic the key - mouse navigation when shift is pressed. 根据光标的新位置设置selectionStart和selectionEnd 模拟按下shift键时的鼠标导航。
Source:

setSelectionStyles(stylesopt, startIndexopt, endIndexopt) → {fabric.IText}

Sets style of a current selection, if no selection exist, do not set anything. 设置当前选择的样式,如果不存在选择,则不设置任何内容。
Parameters:
Name Type Attributes Description
styles Object <optional>
Styles object样式对象
startIndex Number <optional>
Start index to get styles at开始索引获得样式在
endIndex Number <optional>
End index to get styles at, if not specified selectionEnd or startIndex + 1如果没有指定selectionEnd或startIndex + 1,则结束索引以获取样式
Inherited From:
Source:
Returns:
thisArg
Type
fabric.IText

setSubscript(start, end) → {fabric.Text}

Turns the character into an 'inferior figure' (i.e. 'subscript') 把角色变成一个“下等人物”。“下标”)
Parameters:
Name Type Description
start Number selection start选择开始
end Number selection end选择结束
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Text

setSuperscript(start, end) → {fabric.Text}

Turns the character into a 'superior figure' (i.e. 'superscript') 把角色变成一个“高级人物”。“上标”)
Parameters:
Name Type Description
start Number selection start选择开始
end Number selection end选择结束
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Text

setupState(optionsopt) → {fabric.Object}

Setups state of an object 设置对象的状态
Parameters:
Name Type Attributes Description
options Object <optional>
Object with additional `stateProperties` array to include when saving state对象,该对象具有在保存状态时要包含的附加' stateProperties '数组
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

shiftLineStyles(lineIndex, offset)

Shifts line styles up or down 上下移动线条样式
Parameters:
Name Type Description
lineIndex Number Index of a line行索引
offset Number Can any number?可以任意数量吗?
Source:

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. Read as: cache if is needed, or if the feature is enabled but we are not already caching. 决定对象是否应该缓存。创建自己的缓存级别 objectCaching是一个全局标志,胜过一切 当对象绘图方法需要时,应该使用needsitsonncache 缓存的一步。没有任何fabric类需要它。 通常不将对象缓存到组中,因为会缓存外部的组。 读取为:如果需要缓存,或者如果启用了该特性但我们还没有缓存。
Inherited From:
Source:
Returns:
Type
Boolean

straighten() → {fabric.Object}

Straightens an object (rotating it from current angle to one of 0, 90, 180, 270, etc. depending on which is closer) 将对象拉直(将其从当前角度旋转到0、90、180、270等,取决于哪个更接近)
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

styleHas(property, lineIndex) → {Boolean}

Returns true if object has a style property or has it ina specified line This function is used to detect if a text will use a particular property or not. 如果对象有样式属性或在指定行中有,则返回true 此函数用于检测文本是否将使用特定的属性。
Parameters:
Name Type Description
property String to check for来检查
lineIndex Number to check the style on检查样式
Inherited From:
Source:
Returns:
Type
Boolean

toCanvasElement(options) → {HTMLCanvasElement}

Converts an object into a HTMLCanvas element 将对象转换为HTMLCanvas元素
Parameters:
Name Type Description
options Object Options object
Properties
Name Type Attributes Default Description
multiplier Number <optional>
1 Multiplier to scale by放大倍数
left Number <optional>
Cropping left offset. Introduced in v1.2.14裁剪左偏移量。介绍了v1.2.14
top Number <optional>
Cropping top offset. Introduced in v1.2.14种植前抵消。介绍了v1.2.14
width Number <optional>
Cropping width. Introduced in v1.2.14裁剪宽度。介绍了v1.2.14
height Number <optional>
Cropping height. Introduced in v1.2.14种植的高度。介绍了v1.2.14
enableRetinaScaling Boolean <optional>
Enable retina scaling for clone image. Introduce in 1.6.4为克隆图像启用视网膜缩放。在1.6.4,介绍
withoutTransform Boolean <optional>
Remove current object transform ( no scale , no angle, no flip, no skew ). Introduced in 2.3.4删除当前对象变换(无缩放、无角度、无翻转、无倾斜)。介绍了2.3.4
withoutShadow Boolean <optional>
Remove current object shadow. Introduced in 2.4.2移除当前物体阴影。在2.4.2引入
Inherited From:
Source:
Returns:
Returns DOM element with the fabric.Object
Type
HTMLCanvasElement

toClipPathSVG(reviveropt) → {String}

Returns svg clipPath representation of an instance 返回实例的svg clipPath表示
Parameters:
Name Type Attributes Description
reviver function <optional>
Method for further parsing of svg representation.方法用于进一步解析svg表示。
Inherited From:
Source:
Returns:
svg representation of an instance
Type
String

toDatalessObject(propertiesToIncludeopt) → {Object}

Returns (dataless) object representation of an instance 返回实例的(无数据)对象表示
Parameters:
Name Type Attributes Description
propertiesToInclude Array <optional>
Any properties that you might want to additionally include in the output您可能希望在输出中额外包含的任何属性
Inherited From:
Source:
Returns:
Object representation of an instance
Type
Object

toDataURL(options) → {String}

Converts an object into a data-url-like string 将对象转换为类似于数据url的字符串
Parameters:
Name Type Description
options Object Options object
Properties
Name Type Attributes Default Description
format String <optional>
png The format of the output image. Either "jpeg" or "png"输出图像的格式。jpeg或png
quality Number <optional>
1 Quality level (0..1). Only used for jpeg.质量水平(0 . . 1)。仅用于jpeg。
multiplier Number <optional>
1 Multiplier to scale by放大倍数
left Number <optional>
Cropping left offset. Introduced in v1.2.14裁剪左偏移量。介绍了v1.2.14
top Number <optional>
Cropping top offset. Introduced in v1.2.14种植前抵消。介绍了v1.2.14
width Number <optional>
Cropping width. Introduced in v1.2.14裁剪宽度。介绍了v1.2.14
height Number <optional>
Cropping height. Introduced in v1.2.14种植的高度。介绍了v1.2.14
enableRetinaScaling Boolean <optional>
Enable retina scaling for clone image. Introduce in 1.6.4为克隆图像启用视网膜缩放。在1.6.4,介绍
withoutTransform Boolean <optional>
Remove current object transform ( no scale , no angle, no flip, no skew ). Introduced in 2.3.4删除当前对象变换(无缩放、无角度、无翻转、无倾斜)。介绍了2.3.4
withoutShadow Boolean <optional>
Remove current object shadow. Introduced in 2.4.2移除当前物体阴影。在2.4.2引入
Inherited From:
Source:
Returns:
Returns a data: URL containing a representation of the object in the format specified by options.format
Type
String

toJSON(propertiesToIncludeopt) → {Object}

Returns a JSON representation of an instance 返回实例的JSON表示形式
Parameters:
Name Type Attributes Description
propertiesToInclude Array <optional>
Any properties that you might want to additionally include in the output您可能希望在输出中额外包含的任何属性
Inherited From:
Source:
Returns:
JSON
Type
Object

toLocalPoint(point, originX, originY) → {fabric.Point}

Returns the point in local coordinates 返回局部坐标中的点
Parameters:
Name Type Description
point fabric.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'垂直原点:“顶部”、“中心”或“底部”
Inherited From:
Source:
Returns:
Type
fabric.Point

toObject(propertiesToIncludeopt) → {Object}

Returns object representation of an instance 返回实例的对象表示
Parameters:
Name Type Attributes Description
propertiesToInclude Array <optional>
Any properties that you might want to additionally include in the output您可能希望在输出中额外包含的任何属性
Inherited From:
Source:
Returns:
Object representation of an instance
Type
Object

toString() → {String}

Returns string representation of an instance 返回实例的字符串表示形式
Inherited From:
Source:
Returns:
String representation of text object
Type
String

toSVG(reviveropt) → {String}

Returns svg representation of an instance 返回实例的svg表示
Parameters:
Name Type Attributes Description
reviver function <optional>
Method for further parsing of svg representation.方法用于进一步解析svg表示。
Inherited From:
Source:
Returns:
svg representation of an instance
Type
String

transform(ctx)

Transforms context when rendering an object 在呈现对象时转换上下文
Parameters:
Name Type Description
ctx CanvasRenderingContext2D Context上下文
Inherited From:
Source:

translateToCenterPoint(point, originX, originY) → {fabric.Point}

Translates the coordinates from origin to center coordinates (based on the object's dimensions) 将坐标从原点坐标转换为中心坐标(基于对象的尺寸)
Parameters:
Name Type Description
point fabric.Point The point which corresponds to the originX and originY params与originX和originY参数对应的点
originX String Horizontal origin: 'left', 'center' or 'right'水平原点:“左”、“中”或“右”
originY String Vertical origin: 'top', 'center' or 'bottom'垂直原点:“顶部”、“中心”或“底部”
Inherited From:
Source:
Returns:
Type
fabric.Point

translateToGivenOrigin(point, fromOriginX, fromOriginY, toOriginX, toOriginY) → {fabric.Point}

Translates the coordinates from a set of origin to another (based on the object's dimensions) 将坐标从一组原点转换为另一组原点(基于对象的维度)
Parameters:
Name Type Description
point fabric.Point The point which corresponds to the originX and originY params与originX和originY参数对应的点
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'垂直原点:“顶部”、“中心”或“底部”
Inherited From:
Source:
Returns:
Type
fabric.Point

translateToOriginPoint(center, originX, originY) → {fabric.Point}

Translates the coordinates from center to origin coordinates (based on the object's dimensions) 将坐标从中心坐标转换为原点坐标(基于对象的尺寸)
Parameters:
Name Type Description
center fabric.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'垂直原点:“顶部”、“中心”或“底部”
Inherited From:
Source:
Returns:
Type
fabric.Point

tripleClickHandler()

Default handler for triple click, select a line 默认处理程序为三次点击,选择一条线
Source:

viewportCenter() → {fabric.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. 将对象集中在它最后添加到的画布的当前视图中。 你可能需要在定心后对对象调用setCoords来更新控件区域。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

viewportCenterH() → {fabric.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. 将对象水平地居中于它最后添加到的画布的当前视图中。 你可能需要在定心后对对象调用setCoords来更新控件区域。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

viewportCenterV() → {fabric.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. 将对象垂直集中在它最后添加到的画布的当前视图中。 你可能需要在定心后对对象调用setCoords来更新控件区域。
Inherited From:
Source:
Returns:
thisArg
Type
fabric.Object

willDrawShadow() → {Boolean}

Check if this object or a child object will cast a shadow used by Group.shouldCache to know if child has a shadow recursively 检查此对象或子对象是否会投下阴影 所使用的组。shouldCache可以递归地知道child是否有影子
Inherited From:
Source:
Returns:
Type
Boolean

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com