Class: LeaferCanvasBase โ
Hierarchy โ
Canvas
โณ
LeaferCanvasBase
โณโณ
LeaferCanvas
Implements โ
Table of contents โ
Constructors โ
Properties โ
- context
- smooth
- smoothLevel
- opacity
- fillStyle
- strokeStyle
- strokeWidth
- strokeCap
- strokeJoin
- dashOffset
- miterLimit
- shadowBlur
- shadowColor
- shadowOffsetX
- shadowOffsetY
- filter
- font
- fontKerning
- fontStretch
- fontVariantCaps
- textAlign
- textBaseline
- textRendering
- wordSpacing
- letterSpacing
- direction
- innerId
- name
- manager
- size
- bounds
- clientBounds
- config
- autoLayout
- view
- parentView
- unreal
- recycled
- worldTransform
- savedBlendMode
Accessors โ
Methods โ
- __bindContext
- setTransform
- resetTransform
- getTransform
- save
- restore
- transform
- translate
- scale
- rotate
- fill
- stroke
- clip
- fillRect
- strokeRect
- clearRect
- drawImage
- beginPath
- moveTo
- lineTo
- bezierCurveTo
- quadraticCurveTo
- closePath
- arc
- arcTo
- ellipse
- rect
- roundRect
- createConicGradient
- createLinearGradient
- createPattern
- createRadialGradient
- fillText
- measureText
- strokeText
- init
- __createContext
- export
- toBlob
- toDataURL
- saveAs
- resize
- updateViewSize
- updateClientBounds
- getClientBounds
- startAutoLayout
- stopAutoLayout
- setCursor
- setWorld
- useWorldTransform
- setStroke
- setStrokeOptions
- saveBlendMode
- restoreBlendMode
- hitFill
- hitStroke
- hitPixel
- setWorldShadow
- setWorldBlur
- copyWorld
- copyWorldToInner
- copyWorldByReset
- useMask
- useEraser
- fillWorld
- strokeWorld
- clearWorld
- clipWorld
- clear
- isSameSize
- getSameCanvas
- recycle
- updateRender
- unrealCanvas
- destroy
Constructors โ
constructor โ
โข new LeaferCanvasBase(config?
, manager?
): LeaferCanvasBase
Parameters โ
Name | Type |
---|---|
config? | ILeaferCanvasConfig |
manager? | ICanvasManager |
Returns โ
Overrides โ
Canvas.constructor
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:51
Properties โ
context โ
โข context: ICanvasContext2D
Implementation of โ
Inherited from โ
Canvas.context
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:27
smooth โ
โข smooth: boolean
Implementation of โ
Inherited from โ
Canvas.smooth
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:32
smoothLevel โ
โข smoothLevel: ImageSmoothingQuality
Implementation of โ
Inherited from โ
Canvas.smoothLevel
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:35
opacity โ
โข opacity: number
Implementation of โ
Inherited from โ
Canvas.opacity
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:38
fillStyle โ
โข fillStyle: string
| object
Implementation of โ
Inherited from โ
Canvas.fillStyle
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:50
strokeStyle โ
โข strokeStyle: string
| object
Implementation of โ
Inherited from โ
Canvas.strokeStyle
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:53
strokeWidth โ
โข strokeWidth: number
Implementation of โ
Inherited from โ
Canvas.strokeWidth
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:57
strokeCap โ
โข strokeCap: string
Implementation of โ
Inherited from โ
Canvas.strokeCap
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:60
strokeJoin โ
โข strokeJoin: string
Implementation of โ
Inherited from โ
Canvas.strokeJoin
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:63
dashOffset โ
โข dashOffset: number
Implementation of โ
Inherited from โ
Canvas.dashOffset
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:73
miterLimit โ
โข miterLimit: number
Implementation of โ
Inherited from โ
Canvas.miterLimit
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:76
shadowBlur โ
โข shadowBlur: number
Implementation of โ
Inherited from โ
Canvas.shadowBlur
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:80
shadowColor โ
โข shadowColor: string
Implementation of โ
Inherited from โ
Canvas.shadowColor
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:83
shadowOffsetX โ
โข shadowOffsetX: number
Implementation of โ
Inherited from โ
Canvas.shadowOffsetX
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:86
shadowOffsetY โ
โข shadowOffsetY: number
Implementation of โ
Inherited from โ
Canvas.shadowOffsetY
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:89
filter โ
โข filter: string
Implementation of โ
Inherited from โ
Canvas.filter
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:92
font โ
โข font: string
Implementation of โ
Inherited from โ
Canvas.font
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:96
fontKerning โ
โข fontKerning: string
Implementation of โ
Inherited from โ
Canvas.fontKerning
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:99
fontStretch โ
โข fontStretch: string
Implementation of โ
Inherited from โ
Canvas.fontStretch
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:102
fontVariantCaps โ
โข fontVariantCaps: string
Implementation of โ
Inherited from โ
Canvas.fontVariantCaps
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:105
textAlign โ
โข textAlign: string
Implementation of โ
Inherited from โ
Canvas.textAlign
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:109
textBaseline โ
โข textBaseline: string
Implementation of โ
Inherited from โ
Canvas.textBaseline
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:112
textRendering โ
โข textRendering: string
Implementation of โ
Inherited from โ
Canvas.textRendering
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:115
wordSpacing โ
โข wordSpacing: string
Implementation of โ
Inherited from โ
Canvas.wordSpacing
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:118
letterSpacing โ
โข letterSpacing: string
Implementation of โ
Inherited from โ
Canvas.letterSpacing
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:121
direction โ
โข direction: string
Implementation of โ
Inherited from โ
Canvas.direction
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:125
innerId โ
โข Readonly
innerId: number
Implementation of โ
Overrides โ
Canvas.innerId
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:16
name โ
โข name: string
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:18
manager โ
โข manager: ICanvasManager
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:20
size โ
โข size: IScreenSizeData
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:22
bounds โ
โข bounds: IBounds
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:33
clientBounds โ
โข clientBounds: IBoundsData
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:34
config โ
โข config: ILeaferCanvasConfig
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:36
autoLayout โ
โข autoLayout: boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:38
view โ
โข view: any
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:40
parentView โ
โข parentView: any
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:41
unreal โ
โข Optional
unreal: boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:43
recycled โ
โข Optional
recycled: boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:45
worldTransform โ
โข worldTransform: IMatrixData
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:47
savedBlendMode โ
โข Protected
savedBlendMode: IBlendMode
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:49
Accessors โ
blendMode โ
โข get
blendMode(): IBlendMode
Returns โ
Implementation of โ
Inherited from โ
Canvas.blendMode
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:45
โข set
blendMode(value
): void
Parameters โ
Name | Type |
---|---|
value | IBlendMode |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.blendMode
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:40
dashPattern โ
โข get
dashPattern(): number
[]
Returns โ
number
[]
Implementation of โ
Inherited from โ
Canvas.dashPattern
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:68
โข set
dashPattern(value
): void
Parameters โ
Name | Type |
---|---|
value | number [] |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.dashPattern
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:65
width โ
โข get
width(): number
Returns โ
number
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:24
height โ
โข get
height(): number
Returns โ
number
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:25
pixelRatio โ
โข get
pixelRatio(): number
Returns โ
number
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:27
pixelWidth โ
โข get
pixelWidth(): number
Returns โ
number
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:28
pixelHeight โ
โข get
pixelHeight(): number
Returns โ
number
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:29
allowBackgroundColor โ
โข get
allowBackgroundColor(): boolean
Returns โ
boolean
Implementation of โ
ILeaferCanvas.allowBackgroundColor
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:31
Methods โ
__bindContext โ
โธ __bindContext(): void
Returns โ
void
Inherited from โ
Canvas.__bindContext
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:129
setTransform โ
โธ setTransform(_a
, _b?
, _c?
, _d?
, _e?
, _f?
): void
Parameters โ
Name | Type |
---|---|
_a | number | IMatrixData |
_b? | number |
_c? | number |
_d? | number |
_e? | number |
_f? | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.setTransform
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:141
resetTransform โ
โธ resetTransform(): void
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.resetTransform
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:144
getTransform โ
โธ getTransform(): IMatrixData
Returns โ
Implementation of โ
Inherited from โ
Canvas.getTransform
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:147
save โ
โธ save(): void
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.save
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:150
restore โ
โธ restore(): void
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.restore
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:153
transform โ
โธ transform(a
, b?
, c?
, d?
, e?
, f?
): void
Parameters โ
Name | Type |
---|---|
a | number | IMatrixData |
b? | number |
c? | number |
d? | number |
e? | number |
f? | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.transform
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:155
translate โ
โธ translate(_x
, _y
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.translate
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:164
scale โ
โธ scale(_x
, _y
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.scale
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:167
rotate โ
โธ rotate(_angle
): void
Parameters โ
Name | Type |
---|---|
_angle | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.rotate
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:170
fill โ
โธ fill(_path2d?
, _rule?
): void
Parameters โ
Name | Type |
---|---|
_path2d? | IWindingRule | IPath2D |
_rule? | IWindingRule |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.fill
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:173
stroke โ
โธ stroke(_path2d?
): void
Parameters โ
Name | Type |
---|---|
_path2d? | IPath2D |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.stroke
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:176
clip โ
โธ clip(_path2d?
, _rule?
): void
Parameters โ
Name | Type |
---|---|
_path2d? | IWindingRule | IPath2D |
_rule? | IWindingRule |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.clip
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:179
fillRect โ
โธ fillRect(_x
, _y
, _width
, _height
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_width | number |
_height | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.fillRect
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:182
strokeRect โ
โธ strokeRect(_x
, _y
, _width
, _height
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_width | number |
_height | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.strokeRect
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:185
clearRect โ
โธ clearRect(_x
, _y
, _width
, _height
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_width | number |
_height | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.clearRect
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:188
drawImage โ
โธ drawImage(image
, sx
, sy
, sw?
, sh?
, dx?
, dy?
, dw?
, dh?
): void
Parameters โ
Name | Type |
---|---|
image | CanvasImageSource |
sx | number |
sy | number |
sw? | number |
sh? | number |
dx? | number |
dy? | number |
dw? | number |
dh? | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.drawImage
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:190
beginPath โ
โธ beginPath(): void
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.beginPath
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:224
moveTo โ
โธ moveTo(_x
, _y
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.moveTo
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:227
lineTo โ
โธ lineTo(_x
, _y
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.lineTo
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:230
bezierCurveTo โ
โธ bezierCurveTo(_cp1x
, _cp1y
, _cp2x
, _cp2y
, _x
, _y
): void
Parameters โ
Name | Type |
---|---|
_cp1x | number |
_cp1y | number |
_cp2x | number |
_cp2y | number |
_x | number |
_y | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.bezierCurveTo
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:233
quadraticCurveTo โ
โธ quadraticCurveTo(_cpx
, _cpy
, _x
, _y
): void
Parameters โ
Name | Type |
---|---|
_cpx | number |
_cpy | number |
_x | number |
_y | number |
Returns โ
void
Implementation of โ
ILeaferCanvas.quadraticCurveTo
Inherited from โ
Canvas.quadraticCurveTo
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:236
closePath โ
โธ closePath(): void
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.closePath
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:239
arc โ
โธ arc(_x
, _y
, _radius
, _startAngle
, _endAngle
, _anticlockwise?
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_radius | number |
_startAngle | number |
_endAngle | number |
_anticlockwise? | boolean |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.arc
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:242
arcTo โ
โธ arcTo(_x1
, _y1
, _x2
, _y2
, _radius
): void
Parameters โ
Name | Type |
---|---|
_x1 | number |
_y1 | number |
_x2 | number |
_y2 | number |
_radius | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.arcTo
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:245
ellipse โ
โธ ellipse(_x
, _y
, _radiusX
, _radiusY
, _rotation
, _startAngle
, _endAngle
, _anticlockwise?
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_radiusX | number |
_radiusY | number |
_rotation | number |
_startAngle | number |
_endAngle | number |
_anticlockwise? | boolean |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.ellipse
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:248
rect โ
โธ rect(_x
, _y
, _width
, _height
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_width | number |
_height | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.rect
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:251
roundRect โ
โธ roundRect(_x
, _y
, _width
, _height
, _radius?
): void
Parameters โ
Name | Type |
---|---|
_x | number |
_y | number |
_width | number |
_height | number |
_radius? | number | number [] |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.roundRect
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:254
createConicGradient โ
โธ createConicGradient(_startAngle
, _x
, _y
): CanvasGradient
Parameters โ
Name | Type |
---|---|
_startAngle | number |
_x | number |
_y | number |
Returns โ
CanvasGradient
Implementation of โ
ILeaferCanvas.createConicGradient
Inherited from โ
Canvas.createConicGradient
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:261
createLinearGradient โ
โธ createLinearGradient(_x0
, _y0
, _x1
, _y1
): CanvasGradient
Parameters โ
Name | Type |
---|---|
_x0 | number |
_y0 | number |
_x1 | number |
_y1 | number |
Returns โ
CanvasGradient
Implementation of โ
ILeaferCanvas.createLinearGradient
Inherited from โ
Canvas.createLinearGradient
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:264
createPattern โ
โธ createPattern(_image
, _repetition
): CanvasPattern
Parameters โ
Name | Type |
---|---|
_image | CanvasImageSource |
_repetition | string |
Returns โ
CanvasPattern
Implementation of โ
Inherited from โ
Canvas.createPattern
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:267
createRadialGradient โ
โธ createRadialGradient(_x0
, _y0
, _r0
, _x1
, _y1
, _r1
): CanvasGradient
Parameters โ
Name | Type |
---|---|
_x0 | number |
_y0 | number |
_r0 | number |
_x1 | number |
_y1 | number |
_r1 | number |
Returns โ
CanvasGradient
Implementation of โ
ILeaferCanvas.createRadialGradient
Inherited from โ
Canvas.createRadialGradient
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:270
fillText โ
โธ fillText(_text
, _x
, _y
, _maxWidth?
): void
Parameters โ
Name | Type |
---|---|
_text | string |
_x | number |
_y | number |
_maxWidth? | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.fillText
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:274
measureText โ
โธ measureText(_text
): ITextMetrics
Parameters โ
Name | Type |
---|---|
_text | string |
Returns โ
Implementation of โ
Inherited from โ
Canvas.measureText
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:277
strokeText โ
โธ strokeText(_text
, _x
, _y
, _maxWidth?
): void
Parameters โ
Name | Type |
---|---|
_text | string |
_x | number |
_y | number |
_maxWidth? | number |
Returns โ
void
Implementation of โ
Inherited from โ
Canvas.strokeText
Defined in โ
leafer/packages/canvas/canvas/src/Canvas.ts:280
init โ
โธ init(): void
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:68
__createContext โ
โธ __createContext(): void
Returns โ
void
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:70
export โ
โธ export(_filename
, _options?
): string
| Promise
<any
>
Parameters โ
Name | Type |
---|---|
_filename | string |
_options? | number | boolean | IExportOptions |
Returns โ
string
| Promise
<any
>
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:79
toBlob โ
โธ toBlob(_type?
, _quality?
): Promise
<any
>
Parameters โ
Name | Type |
---|---|
_type? | IExportFileType |
_quality? | number |
Returns โ
Promise
<any
>
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:81
toDataURL โ
โธ toDataURL(_type?
, _quality?
): string
| Promise
<string
>
Parameters โ
Name | Type |
---|---|
_type? | IExportImageType |
_quality? | number |
Returns โ
string
| Promise
<string
>
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:83
saveAs โ
โธ saveAs(_filename
, _quality?
): Promise
<boolean
>
Parameters โ
Name | Type |
---|---|
_filename | string |
_quality? | number |
Returns โ
Promise
<boolean
>
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:85
resize โ
โธ resize(size
): void
Parameters โ
Name | Type |
---|---|
size | IScreenSizeData |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:89
updateViewSize โ
โธ updateViewSize(): void
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:117
updateClientBounds โ
โธ updateClientBounds(): void
Returns โ
void
Implementation of โ
ILeaferCanvas.updateClientBounds
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:118
getClientBounds โ
โธ getClientBounds(update?
): IBoundsData
Parameters โ
Name | Type |
---|---|
update? | boolean |
Returns โ
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:119
startAutoLayout โ
โธ startAutoLayout(_autoBounds
, _listener
): void
Parameters โ
Name | Type |
---|---|
_autoBounds | IAutoBounds |
_listener | IResizeEventListener |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:124
stopAutoLayout โ
โธ stopAutoLayout(): void
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:125
setCursor โ
โธ setCursor(_cursor
): void
Parameters โ
Name | Type |
---|---|
_cursor | ICursorType | ICursorType [] |
Returns โ
void
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:127
setWorld โ
โธ setWorld(matrix
, parentMatrix?
): void
Parameters โ
Name | Type |
---|---|
matrix | IMatrixData |
parentMatrix? | IMatrixData |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:129
useWorldTransform โ
โธ useWorldTransform(worldTransform?
): void
Parameters โ
Name | Type |
---|---|
worldTransform? | IMatrixData |
Returns โ
void
Implementation of โ
ILeaferCanvas.useWorldTransform
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:157
setStroke โ
โธ setStroke(color
, strokeWidth
, options?
): void
Parameters โ
Name | Type |
---|---|
color | string | object |
strokeWidth | number |
options? | ICanvasStrokeOptions |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:163
setStrokeOptions โ
โธ setStrokeOptions(options
): void
Parameters โ
Name | Type |
---|---|
options | ICanvasStrokeOptions |
Returns โ
void
Implementation of โ
ILeaferCanvas.setStrokeOptions
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:169
saveBlendMode โ
โธ saveBlendMode(blendMode
): void
Parameters โ
Name | Type |
---|---|
blendMode | IBlendMode |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:177
restoreBlendMode โ
โธ restoreBlendMode(): void
Returns โ
void
Implementation of โ
ILeaferCanvas.restoreBlendMode
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:182
hitFill โ
โธ hitFill(_point
, _fillRule?
): boolean
Parameters โ
Name | Type |
---|---|
_point | IPointData |
_fillRule? | IWindingRule |
Returns โ
boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:188
hitStroke โ
โธ hitStroke(_point
, _strokeWidth?
): boolean
Parameters โ
Name | Type |
---|---|
_point | IPointData |
_strokeWidth? | number |
Returns โ
boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:190
hitPixel โ
โธ hitPixel(_radiusPoint
, _offset?
, _scale?
): boolean
Parameters โ
Name | Type | Default value |
---|---|---|
_radiusPoint | IRadiusPointData | undefined |
_offset? | IPointData | undefined |
_scale | number | 1 |
Returns โ
boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:192
setWorldShadow โ
โธ setWorldShadow(x
, y
, blur
, color?
): void
Parameters โ
Name | Type |
---|---|
x | number |
y | number |
blur | number |
color? | string |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:196
setWorldBlur โ
โธ setWorldBlur(blur
): void
Parameters โ
Name | Type |
---|---|
blur | number |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:204
copyWorld โ
โธ copyWorld(canvas
, from?
, to?
, blendMode?
): void
Parameters โ
Name | Type |
---|---|
canvas | ILeaferCanvas |
from? | IBoundsData |
to? | IBoundsData |
blendMode? | IBlendMode |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:210
copyWorldToInner โ
โธ copyWorldToInner(canvas
, fromWorld
, toInnerBounds
, blendMode?
): void
Parameters โ
Name | Type |
---|---|
canvas | ILeaferCanvas |
fromWorld | IMatrixWithBoundsData |
toInnerBounds | IBoundsData |
blendMode? | IBlendMode |
Returns โ
void
Implementation of โ
ILeaferCanvas.copyWorldToInner
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:222
copyWorldByReset โ
โธ copyWorldByReset(canvas
, from?
, to?
, blendMode?
, onlyResetTransform?
): void
Parameters โ
Name | Type |
---|---|
canvas | ILeaferCanvas |
from? | IBoundsData |
to? | IBoundsData |
blendMode? | IBlendMode |
onlyResetTransform? | boolean |
Returns โ
void
Implementation of โ
ILeaferCanvas.copyWorldByReset
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:236
useMask โ
โธ useMask(maskCanvas
, fromBounds?
, toBounds?
): void
Parameters โ
Name | Type |
---|---|
maskCanvas | ILeaferCanvas |
fromBounds? | IBoundsData |
toBounds? | IBoundsData |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:242
useEraser โ
โธ useEraser(eraserCanvas
, fromBounds?
, toBounds?
): void
Parameters โ
Name | Type |
---|---|
eraserCanvas | ILeaferCanvas |
fromBounds? | IBoundsData |
toBounds? | IBoundsData |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:246
fillWorld โ
โธ fillWorld(bounds
, color
, blendMode?
): void
Parameters โ
Name | Type |
---|---|
bounds | IBoundsData |
color | string | object |
blendMode? | IBlendMode |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:250
strokeWorld โ
โธ strokeWorld(bounds
, color
, blendMode?
): void
Parameters โ
Name | Type |
---|---|
bounds | IBoundsData |
color | string | object |
blendMode? | IBlendMode |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:258
clearWorld โ
โธ clearWorld(bounds
, ceilPixel?
): void
Parameters โ
Name | Type |
---|---|
bounds | IBoundsData |
ceilPixel? | boolean |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:266
clipWorld โ
โธ clipWorld(bounds
, ceilPixel?
): void
Parameters โ
Name | Type |
---|---|
bounds | IBoundsData |
ceilPixel? | boolean |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:272
clear โ
โธ clear(): void
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:281
isSameSize โ
โธ isSameSize(size
): boolean
Parameters โ
Name | Type |
---|---|
size | IScreenSizeData |
Returns โ
boolean
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:289
getSameCanvas โ
โธ getSameCanvas(useSameWorldTransform?
, useSameSmooth?
): ILeaferCanvas
Parameters โ
Name | Type |
---|---|
useSameWorldTransform? | boolean |
useSameSmooth? | boolean |
Returns โ
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:294
recycle โ
โธ recycle(clearBounds?
): void
Parameters โ
Name | Type |
---|---|
clearBounds? | IBoundsData |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:305
updateRender โ
โธ updateRender(_bounds?
): void
Parameters โ
Name | Type |
---|---|
_bounds? | IBoundsData |
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:313
unrealCanvas โ
โธ unrealCanvas(): void
Returns โ
void
Implementation of โ
Defined in โ
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:315
destroy โ
โธ destroy(): void
Returns โ
void
Implementation of โ
Overrides โ
Canvas.destroy