forked from konvajs/konva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FastLayer.ts
29 lines (27 loc) · 935 Bytes
/
FastLayer.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Util } from './Util';
import { Layer } from './Layer';
import { _registerNode } from './Global';
/**
* FastLayer constructor. **DEPRECATED!** Please use `Konva.Layer({ listening: false})` instead. Layers are tied to their own canvas element and are used
* to contain shapes only. If you don't need node nesting, mouse and touch interactions,
* or event pub/sub, you should use FastLayer instead of Layer to create your layers.
* It renders about 2x faster than normal layers.
*
* @constructor
* @memberof Konva
* @augments Konva.Layer
* @@containerParams
* @example
* var layer = new Konva.FastLayer();
*/
export class FastLayer extends Layer {
constructor(attrs) {
super(attrs);
this.listening(false);
Util.warn(
'Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.'
);
}
}
FastLayer.prototype.nodeType = 'FastLayer';
_registerNode(FastLayer);