2021-05-05 22:54:03 +08:00
|
|
|
import { Util } from './Util';
|
|
|
|
import { Layer } from './Layer';
|
|
|
|
import { _registerNode } from './Global';
|
2019-01-02 04:59:27 +08:00
|
|
|
|
|
|
|
/**
|
2020-05-15 00:13:47 +08:00
|
|
|
* FastLayer constructor. **DEPRECATED!** Please use `Konva.Layer({ listening: false})` instead. Layers are tied to their own canvas element and are used
|
2019-01-02 04:59:27 +08:00
|
|
|
* 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.
|
2020-05-15 00:13:47 +08:00
|
|
|
*
|
2019-01-02 04:59:27 +08:00
|
|
|
* @constructor
|
|
|
|
* @memberof Konva
|
2020-05-15 00:13:47 +08:00
|
|
|
* @augments Konva.Layer
|
2025-03-12 22:29:07 +08:00
|
|
|
@@containerParams
|
2019-01-02 04:59:27 +08:00
|
|
|
* @example
|
|
|
|
* var layer = new Konva.FastLayer();
|
|
|
|
*/
|
2020-05-15 00:13:47 +08:00
|
|
|
export class FastLayer extends Layer {
|
|
|
|
constructor(attrs) {
|
|
|
|
super(attrs);
|
|
|
|
this.listening(false);
|
2020-06-10 04:55:08 +08:00
|
|
|
Util.warn(
|
|
|
|
'Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.'
|
|
|
|
);
|
2019-01-02 04:59:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-27 21:06:04 +08:00
|
|
|
FastLayer.prototype.nodeType = 'FastLayer';
|
|
|
|
_registerNode(FastLayer);
|