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
- useGrayscaleAlpha
- useMask
- useEraser
- fillWorld
- strokeWorld
- clearWorld
- clipWorld
- clear
- setTempBounds
- 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
, safeResize?
): void
Parameters â
Name | Type | Default value |
---|---|---|
size | IScreenSizeData | undefined |
safeResize | boolean | true |
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:118
updateClientBounds â
⸠updateClientBounds(): void
Returns â
void
Implementation of â
ILeaferCanvas.updateClientBounds
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:119
getClientBounds â
⸠getClientBounds(update?
): IBoundsData
Parameters â
Name | Type |
---|---|
update? | boolean |
Returns â
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:120
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:125
stopAutoLayout â
⸠stopAutoLayout(): void
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:126
setCursor â
⸠setCursor(_cursor
): void
Parameters â
Name | Type |
---|---|
_cursor | ICursorType | ICursorType [] |
Returns â
void
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:128
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:130
useWorldTransform â
⸠useWorldTransform(worldTransform?
): void
Parameters â
Name | Type |
---|---|
worldTransform? | IMatrixData |
Returns â
void
Implementation of â
ILeaferCanvas.useWorldTransform
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:158
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:164
setStrokeOptions â
⸠setStrokeOptions(options
): void
Parameters â
Name | Type |
---|---|
options | ICanvasStrokeOptions |
Returns â
void
Implementation of â
ILeaferCanvas.setStrokeOptions
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:170
saveBlendMode â
⸠saveBlendMode(blendMode
): void
Parameters â
Name | Type |
---|---|
blendMode | IBlendMode |
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:178
restoreBlendMode â
⸠restoreBlendMode(): void
Returns â
void
Implementation of â
ILeaferCanvas.restoreBlendMode
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:183
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:189
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:191
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:193
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:197
setWorldBlur â
⸠setWorldBlur(blur
): void
Parameters â
Name | Type |
---|---|
blur | number |
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:205
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:211
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:223
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:237
useGrayscaleAlpha â
⸠useGrayscaleAlpha(bounds
): void
Parameters â
Name | Type |
---|---|
bounds | IBoundsData |
Returns â
void
Implementation of â
ILeaferCanvas.useGrayscaleAlpha
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:243
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:257
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:261
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:265
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:273
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:281
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:286
clear â
⸠clear(): void
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:294
setTempBounds â
⸠setTempBounds(bounds
, ceil?
, intersect?
): void
Parameters â
Name | Type |
---|---|
bounds | IBoundsData |
ceil? | boolean |
intersect? | boolean |
Returns â
void
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:302
isSameSize â
⸠isSameSize(size
): boolean
Parameters â
Name | Type |
---|---|
size | IScreenSizeData |
Returns â
boolean
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:309
getSameCanvas â
⸠getSameCanvas(useSameWorldTransform?
, useSameSmooth?
): ILeaferCanvas
Parameters â
Name | Type |
---|---|
useSameWorldTransform? | boolean |
useSameSmooth? | boolean |
Returns â
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:314
recycle â
⸠recycle(clearBounds?
): void
Parameters â
Name | Type |
---|---|
clearBounds? | IBoundsData |
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:325
updateRender â
⸠updateRender(_bounds?
): void
Parameters â
Name | Type |
---|---|
_bounds? | IBoundsData |
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:333
unrealCanvas â
⸠unrealCanvas(): void
Returns â
void
Implementation of â
Defined in â
leafer/packages/canvas/canvas/src/LeaferCanvasBase.ts:335
destroy â
⸠destroy(): void
Returns â
void
Implementation of â
Overrides â
Canvas.destroy