@leafer/canvas 1.0.0-beta.9 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -10
- package/src/Canvas.ts +7 -2
- package/src/HitCanvasManager.ts +10 -10
- package/src/LeaferCanvasBase.ts +27 -19
- package/types/index.d.ts +159 -0
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/canvas",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"description": "@leafer/canvas",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
|
+
"types": "types/index.d.ts",
|
|
8
9
|
"files": [
|
|
9
|
-
"src"
|
|
10
|
+
"src",
|
|
11
|
+
"types",
|
|
12
|
+
"dist"
|
|
10
13
|
],
|
|
11
14
|
"repository": {
|
|
12
15
|
"type": "git",
|
|
@@ -19,15 +22,15 @@
|
|
|
19
22
|
"leaferjs"
|
|
20
23
|
],
|
|
21
24
|
"dependencies": {
|
|
22
|
-
"@leafer/file": "1.0.0-
|
|
23
|
-
"@leafer/list": "1.0.0-
|
|
24
|
-
"@leafer/math": "1.0.0-
|
|
25
|
-
"@leafer/data": "1.0.0-
|
|
26
|
-
"@leafer/path": "1.0.0-
|
|
27
|
-
"@leafer/debug": "1.0.0-
|
|
28
|
-
"@leafer/platform": "1.0.0-
|
|
25
|
+
"@leafer/file": "1.0.0-rc.2",
|
|
26
|
+
"@leafer/list": "1.0.0-rc.2",
|
|
27
|
+
"@leafer/math": "1.0.0-rc.2",
|
|
28
|
+
"@leafer/data": "1.0.0-rc.2",
|
|
29
|
+
"@leafer/path": "1.0.0-rc.2",
|
|
30
|
+
"@leafer/debug": "1.0.0-rc.2",
|
|
31
|
+
"@leafer/platform": "1.0.0-rc.2"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@leafer/interface": "1.0.0-
|
|
34
|
+
"@leafer/interface": "1.0.0-rc.2"
|
|
32
35
|
}
|
|
33
36
|
}
|
package/src/Canvas.ts
CHANGED
|
@@ -156,8 +156,13 @@ export class Canvas implements ICanvasAttr {
|
|
|
156
156
|
@contextMethod()
|
|
157
157
|
public restore(): void { }
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
public transform(a: number | IMatrixData, b?: number, c?: number, d?: number, e?: number, f?: number): void {
|
|
160
|
+
if (typeof a === 'object') {
|
|
161
|
+
this.context.transform(a.a, a.b, a.c, a.d, a.e, a.f)
|
|
162
|
+
} else {
|
|
163
|
+
this.context.transform(a, b, c, d, e, f)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
161
166
|
|
|
162
167
|
@contextMethod()
|
|
163
168
|
public translate(_x: number, _y: number): void { }
|
package/src/HitCanvasManager.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IScreenSizeData, IHitCanvasManager, ILeaf, IHitCanvas,
|
|
1
|
+
import { IScreenSizeData, IHitCanvasManager, ILeaf, IHitCanvas, ILeafList } from '@leafer/interface'
|
|
2
2
|
import { LeafList } from '@leafer/list'
|
|
3
3
|
import { Creator } from '@leafer/platform'
|
|
4
4
|
|
|
@@ -10,8 +10,6 @@ export class HitCanvasManager extends CanvasManager implements IHitCanvasManager
|
|
|
10
10
|
protected pathTypeList: ILeafList = new LeafList()
|
|
11
11
|
protected imageTypeList: ILeafList = new LeafList()
|
|
12
12
|
|
|
13
|
-
public get(_size: IScreenSizeData): ILeaferCanvas { return undefined }
|
|
14
|
-
|
|
15
13
|
public getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas {
|
|
16
14
|
this.imageTypeList.push(leaf)
|
|
17
15
|
return Creator.hitCanvas(size)
|
|
@@ -31,13 +29,15 @@ export class HitCanvasManager extends CanvasManager implements IHitCanvasManager
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
protected __clearLeafList(leafList: ILeafList): void {
|
|
34
|
-
leafList.
|
|
35
|
-
|
|
36
|
-
leaf.__hitCanvas
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
if (leafList.length) {
|
|
33
|
+
leafList.forEach(leaf => {
|
|
34
|
+
if (leaf.__hitCanvas) {
|
|
35
|
+
leaf.__hitCanvas.destroy()
|
|
36
|
+
leaf.__hitCanvas = null
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
leafList.reset()
|
|
40
|
+
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
public clear(): void {
|
package/src/LeaferCanvasBase.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBounds, ILeaferCanvas, ICanvasStrokeOptions, ILeaferCanvasConfig, IMatrixData, IBoundsData, IAutoBounds, IScreenSizeData, IResizeEventListener, IMatrixWithBoundsData, IPointData, InnerId, ICanvasManager, IWindingRule, IBlendMode, IExportImageType, IExportFileType, IBlob } from '@leafer/interface'
|
|
1
|
+
import { IBounds, ILeaferCanvas, ICanvasStrokeOptions, ILeaferCanvasConfig, IMatrixData, IBoundsData, IAutoBounds, IScreenSizeData, IResizeEventListener, IMatrixWithBoundsData, IPointData, InnerId, ICanvasManager, IWindingRule, IBlendMode, IExportImageType, IExportFileType, IBlob, ICursorType } from '@leafer/interface'
|
|
2
2
|
import { Bounds, BoundsHelper, IncrementId } from '@leafer/math'
|
|
3
3
|
import { Creator, Platform } from '@leafer/platform'
|
|
4
4
|
import { DataHelper } from '@leafer/data'
|
|
@@ -16,7 +16,7 @@ export const canvasSizeAttrs = ['width', 'height', 'pixelRatio']
|
|
|
16
16
|
|
|
17
17
|
export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
18
18
|
|
|
19
|
-
public readonly innerId: InnerId
|
|
19
|
+
declare public readonly innerId: InnerId
|
|
20
20
|
|
|
21
21
|
public name: string
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
26
26
|
public get pixelWidth(): number { return this.width * this.pixelRatio }
|
|
27
27
|
public get pixelHeight(): number { return this.height * this.pixelRatio }
|
|
28
28
|
|
|
29
|
-
public get allowBackgroundColor(): boolean { return this.view && this.parentView
|
|
29
|
+
public get allowBackgroundColor(): boolean { return this.view && this.parentView }
|
|
30
30
|
|
|
31
31
|
public bounds: IBounds
|
|
32
32
|
public clientBounds: IBoundsData
|
|
@@ -40,8 +40,6 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
40
40
|
|
|
41
41
|
public unreal?: boolean
|
|
42
42
|
|
|
43
|
-
public offscreen: boolean
|
|
44
|
-
|
|
45
43
|
public recycled?: boolean
|
|
46
44
|
|
|
47
45
|
public worldTransform: IMatrixData = {} as IMatrixData
|
|
@@ -60,7 +58,6 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
60
58
|
this.autoLayout = !width || !height
|
|
61
59
|
|
|
62
60
|
this.pixelRatio = pixelRatio
|
|
63
|
-
this.offscreen = Platform.isWorker || config.offscreen
|
|
64
61
|
this.config = config
|
|
65
62
|
|
|
66
63
|
this.init()
|
|
@@ -68,7 +65,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
68
65
|
|
|
69
66
|
public init(): void { }
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
public __createContext(): void {
|
|
72
69
|
this.context = this.view.getContext('2d')
|
|
73
70
|
this.__bindContext()
|
|
74
71
|
}
|
|
@@ -86,7 +83,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
86
83
|
})
|
|
87
84
|
}
|
|
88
85
|
|
|
89
|
-
public toDataURL(type?: IExportImageType, quality?: number): string {
|
|
86
|
+
public toDataURL(type?: IExportImageType, quality?: number): string | Promise<string> {
|
|
90
87
|
const canvas = this.getSaveCanvas(type)
|
|
91
88
|
const data = Platform.origin.canvasToDataURL(canvas.view, type, quality)
|
|
92
89
|
canvas.recycle()
|
|
@@ -149,6 +146,8 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
149
146
|
public startAutoLayout(_autoBounds: IAutoBounds, _listener: IResizeEventListener): void { }
|
|
150
147
|
public stopAutoLayout(): void { }
|
|
151
148
|
|
|
149
|
+
public setCursor(_cursor: ICursorType | ICursorType[]): void { }
|
|
150
|
+
|
|
152
151
|
public setWorld(matrix: IMatrixData, parentMatrix?: IMatrixData, onlyTranslate?: boolean): void {
|
|
153
152
|
const { pixelRatio } = this
|
|
154
153
|
const w = this.worldTransform
|
|
@@ -188,6 +187,12 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
188
187
|
}
|
|
189
188
|
}
|
|
190
189
|
|
|
190
|
+
public useWorldTransform(worldTransform?: IMatrixData): void {
|
|
191
|
+
if (worldTransform) this.worldTransform = worldTransform
|
|
192
|
+
const w = this.worldTransform
|
|
193
|
+
if (w) this.setTransform(w.a, w.b, w.c, w.d, w.e, w.f)
|
|
194
|
+
}
|
|
195
|
+
|
|
191
196
|
public setStroke(color: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void {
|
|
192
197
|
if (strokeWidth) this.strokeWidth = strokeWidth
|
|
193
198
|
if (color) this.strokeStyle = color
|
|
@@ -261,6 +266,12 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
261
266
|
if (blendMode) this.blendMode = 'source-over'
|
|
262
267
|
}
|
|
263
268
|
|
|
269
|
+
public copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: IBlendMode): void {
|
|
270
|
+
this.resetTransform()
|
|
271
|
+
this.copyWorld(canvas, from, to, blendMode)
|
|
272
|
+
this.useWorldTransform()
|
|
273
|
+
}
|
|
274
|
+
|
|
264
275
|
public useMask(maskCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void {
|
|
265
276
|
this.copyWorld(maskCanvas, fromBounds, toBounds, 'destination-in')
|
|
266
277
|
}
|
|
@@ -321,10 +332,7 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
321
332
|
|
|
322
333
|
canvas.save()
|
|
323
334
|
|
|
324
|
-
if (useSameWorldTransform) {
|
|
325
|
-
const w = this.worldTransform
|
|
326
|
-
canvas.setTransform(w.a, w.b, w.c, w.d, w.e, w.f)
|
|
327
|
-
}
|
|
335
|
+
if (useSameWorldTransform) canvas.useWorldTransform({ ...this.worldTransform })
|
|
328
336
|
|
|
329
337
|
return canvas
|
|
330
338
|
}
|
|
@@ -342,17 +350,17 @@ export class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
|
342
350
|
}
|
|
343
351
|
|
|
344
352
|
public recycle(): void {
|
|
345
|
-
this.
|
|
346
|
-
|
|
353
|
+
if (!this.recycled) {
|
|
354
|
+
this.restore()
|
|
355
|
+
this.manager ? this.manager.recycle(this) : this.destroy()
|
|
356
|
+
}
|
|
347
357
|
}
|
|
348
358
|
|
|
359
|
+
public updateRender(): void { }
|
|
360
|
+
|
|
349
361
|
public unrealCanvas(): void { }
|
|
350
362
|
|
|
351
363
|
public destroy(): void {
|
|
352
|
-
this.manager = null
|
|
353
|
-
this.view = null
|
|
354
|
-
this.parentView = null
|
|
355
|
-
this.context = null
|
|
356
|
-
this.config = null
|
|
364
|
+
this.manager = this.view = this.parentView = null
|
|
357
365
|
}
|
|
358
366
|
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { ICanvasManager, ILeaferCanvas, IScreenSizeData, IHitCanvasManager, ILeafList, ILeaf, IHitCanvas, ICanvasAttr, InnerId, ICanvasContext2D, IBlendMode, IMatrixData, IPath2D, IWindingRule, ITextMetrics, IBounds, IBoundsData, ILeaferCanvasConfig, IExportFileType, IBlob, IExportImageType, IAutoBounds, IResizeEventListener, ICursorType, ICanvasStrokeOptions, IPointData, IMatrixWithBoundsData, IPathDrawer } from '@leafer/interface';
|
|
2
|
+
|
|
3
|
+
declare class CanvasManager implements ICanvasManager {
|
|
4
|
+
list: ILeaferCanvas[];
|
|
5
|
+
add(canvas: ILeaferCanvas): void;
|
|
6
|
+
get(size: IScreenSizeData): ILeaferCanvas;
|
|
7
|
+
recycle(old: ILeaferCanvas): void;
|
|
8
|
+
clearRecycled(): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare class HitCanvasManager extends CanvasManager implements IHitCanvasManager {
|
|
14
|
+
protected pathTypeList: ILeafList;
|
|
15
|
+
protected imageTypeList: ILeafList;
|
|
16
|
+
getImageType(leaf: ILeaf, size: IScreenSizeData): IHitCanvas;
|
|
17
|
+
getPathType(leaf: ILeaf): IHitCanvas;
|
|
18
|
+
clearImageType(): void;
|
|
19
|
+
clearPathType(): void;
|
|
20
|
+
protected __clearLeafList(leafList: ILeafList): void;
|
|
21
|
+
clear(): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class Canvas implements ICanvasAttr {
|
|
25
|
+
readonly innerId: InnerId;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
context: ICanvasContext2D;
|
|
29
|
+
smooth: boolean;
|
|
30
|
+
smoothLevel: ImageSmoothingQuality;
|
|
31
|
+
opacity: number;
|
|
32
|
+
set blendMode(value: IBlendMode);
|
|
33
|
+
get blendMode(): IBlendMode;
|
|
34
|
+
fillStyle: string | object;
|
|
35
|
+
strokeStyle: string | object;
|
|
36
|
+
strokeWidth: number;
|
|
37
|
+
strokeCap: string;
|
|
38
|
+
strokeJoin: string;
|
|
39
|
+
set dashPattern(value: number[]);
|
|
40
|
+
get dashPattern(): number[];
|
|
41
|
+
dashOffset: number;
|
|
42
|
+
miterLimit: number;
|
|
43
|
+
shadowBlur: number;
|
|
44
|
+
shadowColor: string;
|
|
45
|
+
shadowOffsetX: number;
|
|
46
|
+
shadowOffsetY: number;
|
|
47
|
+
filter: string;
|
|
48
|
+
font: string;
|
|
49
|
+
fontKerning: string;
|
|
50
|
+
fontStretch: string;
|
|
51
|
+
fontVariantCaps: string;
|
|
52
|
+
textAlign: string;
|
|
53
|
+
textBaseline: string;
|
|
54
|
+
textRendering: string;
|
|
55
|
+
wordSpacing: string;
|
|
56
|
+
letterSpacing: string;
|
|
57
|
+
direction: string;
|
|
58
|
+
__bindContext(): void;
|
|
59
|
+
setTransform(_a: number | IMatrixData, _b?: number, _c?: number, _d?: number, _e?: number, _f?: number): void;
|
|
60
|
+
resetTransform(): void;
|
|
61
|
+
getTransform(): IMatrixData;
|
|
62
|
+
save(): void;
|
|
63
|
+
restore(): void;
|
|
64
|
+
transform(a: number | IMatrixData, b?: number, c?: number, d?: number, e?: number, f?: number): void;
|
|
65
|
+
translate(_x: number, _y: number): void;
|
|
66
|
+
scale(_x: number, _y: number): void;
|
|
67
|
+
rotate(_angle: number): void;
|
|
68
|
+
fill(_path2d?: IPath2D | IWindingRule, _rule?: IWindingRule): void;
|
|
69
|
+
stroke(_path2d?: IPath2D): void;
|
|
70
|
+
clip(_path2d?: IPath2D | IWindingRule, _rule?: IWindingRule): void;
|
|
71
|
+
fillRect(_x: number, _y: number, _width: number, _height: number): void;
|
|
72
|
+
strokeRect(_x: number, _y: number, _width: number, _height: number): void;
|
|
73
|
+
clearRect(_x: number, _y: number, _width: number, _height: number): void;
|
|
74
|
+
drawImage(image: CanvasImageSource, sx: number, sy: number, sw?: number, sh?: number, dx?: number, dy?: number, dw?: number, dh?: number): void;
|
|
75
|
+
beginPath(): void;
|
|
76
|
+
moveTo(_x: number, _y: number): void;
|
|
77
|
+
lineTo(_x: number, _y: number): void;
|
|
78
|
+
bezierCurveTo(_cp1x: number, _cp1y: number, _cp2x: number, _cp2y: number, _x: number, _y: number): void;
|
|
79
|
+
quadraticCurveTo(_cpx: number, _cpy: number, _x: number, _y: number): void;
|
|
80
|
+
closePath(): void;
|
|
81
|
+
arc(_x: number, _y: number, _radius: number, _startAngle: number, _endAngle: number, _anticlockwise?: boolean): void;
|
|
82
|
+
arcTo(_x1: number, _y1: number, _x2: number, _y2: number, _radius: number): void;
|
|
83
|
+
ellipse(_x: number, _y: number, _radiusX: number, _radiusY: number, _rotation: number, _startAngle: number, _endAngle: number, _anticlockwise?: boolean): void;
|
|
84
|
+
rect(_x: number, _y: number, _width: number, _height: number): void;
|
|
85
|
+
roundRect(_x: number, _y: number, _width: number, _height: number, _radius?: number | number[]): void;
|
|
86
|
+
createConicGradient(_startAngle: number, _x: number, _y: number): CanvasGradient;
|
|
87
|
+
createLinearGradient(_x0: number, _y0: number, _x1: number, _y1: number): CanvasGradient;
|
|
88
|
+
createPattern(_image: CanvasImageSource, _repetition: string | null): CanvasPattern | null;
|
|
89
|
+
createRadialGradient(_x0: number, _y0: number, _r0: number, _x1: number, _y1: number, _r1: number): CanvasGradient;
|
|
90
|
+
fillText(_text: string, _x: number, _y: number, _maxWidth?: number): void;
|
|
91
|
+
measureText(_text: string): ITextMetrics;
|
|
92
|
+
strokeText(_text: string, _x: number, _y: number, _maxWidth?: number): void;
|
|
93
|
+
destroy(): void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const canvasSizeAttrs: string[];
|
|
97
|
+
declare class LeaferCanvasBase extends Canvas implements ILeaferCanvas {
|
|
98
|
+
readonly innerId: InnerId;
|
|
99
|
+
name: string;
|
|
100
|
+
manager: ICanvasManager;
|
|
101
|
+
pixelRatio: number;
|
|
102
|
+
get pixelWidth(): number;
|
|
103
|
+
get pixelHeight(): number;
|
|
104
|
+
get allowBackgroundColor(): boolean;
|
|
105
|
+
bounds: IBounds;
|
|
106
|
+
clientBounds: IBoundsData;
|
|
107
|
+
config: ILeaferCanvasConfig;
|
|
108
|
+
autoLayout: boolean;
|
|
109
|
+
view: any;
|
|
110
|
+
parentView: any;
|
|
111
|
+
unreal?: boolean;
|
|
112
|
+
recycled?: boolean;
|
|
113
|
+
worldTransform: IMatrixData;
|
|
114
|
+
protected savedBlendMode: IBlendMode;
|
|
115
|
+
constructor(config?: ILeaferCanvasConfig, manager?: ICanvasManager);
|
|
116
|
+
init(): void;
|
|
117
|
+
__createContext(): void;
|
|
118
|
+
toBlob(type?: IExportFileType, quality?: number): Promise<IBlob>;
|
|
119
|
+
toDataURL(type?: IExportImageType, quality?: number): string | Promise<string>;
|
|
120
|
+
saveAs(filename: string, quality?: number): Promise<boolean>;
|
|
121
|
+
getSaveCanvas(type: string): ILeaferCanvas;
|
|
122
|
+
resize(size: IScreenSizeData): void;
|
|
123
|
+
updateViewSize(): void;
|
|
124
|
+
updateClientBounds(): void;
|
|
125
|
+
startAutoLayout(_autoBounds: IAutoBounds, _listener: IResizeEventListener): void;
|
|
126
|
+
stopAutoLayout(): void;
|
|
127
|
+
setCursor(_cursor: ICursorType | ICursorType[]): void;
|
|
128
|
+
setWorld(matrix: IMatrixData, parentMatrix?: IMatrixData, onlyTranslate?: boolean): void;
|
|
129
|
+
useWorldTransform(worldTransform?: IMatrixData): void;
|
|
130
|
+
setStroke(color: string | object, strokeWidth: number, options?: ICanvasStrokeOptions): void;
|
|
131
|
+
setStrokeOptions(options: ICanvasStrokeOptions): void;
|
|
132
|
+
saveBlendMode(blendMode: IBlendMode): void;
|
|
133
|
+
restoreBlendMode(): void;
|
|
134
|
+
hitFill(point: IPointData, fillRule?: IWindingRule): boolean;
|
|
135
|
+
hitStroke(point: IPointData, strokeWidth?: number): boolean;
|
|
136
|
+
setWorldShadow(x: number, y: number, blur: number, color?: string): void;
|
|
137
|
+
setWorldBlur(blur: number): void;
|
|
138
|
+
copyWorld(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: IBlendMode): void;
|
|
139
|
+
copyWorldToInner(canvas: ILeaferCanvas, fromWorld: IMatrixWithBoundsData, toInnerBounds: IBoundsData, blendMode?: IBlendMode): void;
|
|
140
|
+
copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: IBlendMode): void;
|
|
141
|
+
useMask(maskCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void;
|
|
142
|
+
useEraser(eraserCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void;
|
|
143
|
+
fillWorld(bounds: IBoundsData, color: string | object, blendMode?: IBlendMode): void;
|
|
144
|
+
strokeWorld(bounds: IBoundsData, color: string | object, blendMode?: IBlendMode): void;
|
|
145
|
+
clearWorld(bounds: IBoundsData, ceilPixel?: boolean): void;
|
|
146
|
+
clipWorld(bounds: IBoundsData, ceilPixel?: boolean): void;
|
|
147
|
+
clear(): void;
|
|
148
|
+
isSameSize(size: IScreenSizeData): boolean;
|
|
149
|
+
getSameCanvas(useSameWorldTransform?: boolean): ILeaferCanvas;
|
|
150
|
+
getBiggerCanvas(addWidth: number, addHeight: number): ILeaferCanvas;
|
|
151
|
+
recycle(): void;
|
|
152
|
+
updateRender(): void;
|
|
153
|
+
unrealCanvas(): void;
|
|
154
|
+
destroy(): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare function canvasPatch(drawer: IPathDrawer): void;
|
|
158
|
+
|
|
159
|
+
export { CanvasManager, HitCanvasManager, LeaferCanvasBase, canvasPatch, canvasSizeAttrs };
|