mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 18:46:08 +08:00
Add node.isCached()
method
This commit is contained in:
parent
cdb1916e27
commit
d191e21cc3
@ -5,6 +5,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Not released:
|
||||
|
||||
* Add `node.isCached()` method
|
||||
|
||||
## [4.0.3][2019-08-08]
|
||||
|
||||
* Slightly changed `mousemove` event flow. It triggers for first `mouseover` event too
|
||||
|
16
konva.js
16
konva.js
@ -8,7 +8,7 @@
|
||||
* Konva JavaScript Framework v4.0.3
|
||||
* http://konvajs.org/
|
||||
* Licensed under the MIT
|
||||
* Date: Thu Aug 08 2019
|
||||
* Date: Sat Aug 10 2019
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
@ -2759,6 +2759,15 @@
|
||||
});
|
||||
return this;
|
||||
};
|
||||
/**
|
||||
* determine if node is currently cached
|
||||
* @method
|
||||
* @name Konva.Node#isCached
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
Node.prototype.isCached = function () {
|
||||
return this._cache.has('canvas');
|
||||
};
|
||||
/**
|
||||
* Return client rectangle {x, y, width, height} of node. This rectangle also include all styling (strokes, shadows, etc).
|
||||
* The rectangle position is relative to parent container.
|
||||
@ -4362,7 +4371,10 @@
|
||||
*/
|
||||
Node.prototype.stopDrag = function () {
|
||||
var evt = {};
|
||||
DD._dragElements.get(this._id).dragStopped = true;
|
||||
var elem = DD._dragElements.get(this._id);
|
||||
if (elem) {
|
||||
elem.dragStopped = true;
|
||||
}
|
||||
DD._endDragBefore(evt);
|
||||
DD._endDragAfter(evt);
|
||||
};
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -56,7 +56,7 @@ echo "create new git tag"
|
||||
git tag $1 >/dev/null
|
||||
|
||||
echo "generate documentation"
|
||||
npm start api >/dev/null
|
||||
npm run api >/dev/null
|
||||
|
||||
|
||||
|
||||
|
15
src/Node.ts
15
src/Node.ts
@ -454,6 +454,16 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* determine if node is currently cached
|
||||
* @method
|
||||
* @name Konva.Node#isCached
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isCached() {
|
||||
return this._cache.has('canvas');
|
||||
}
|
||||
|
||||
abstract drawScene(
|
||||
canvas?: Canvas,
|
||||
top?: Node,
|
||||
@ -2288,7 +2298,10 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
*/
|
||||
stopDrag() {
|
||||
var evt = {};
|
||||
DD._dragElements.get(this._id).dragStopped = true;
|
||||
const elem = DD._dragElements.get(this._id);
|
||||
if (elem) {
|
||||
elem.dragStopped = true;
|
||||
}
|
||||
DD._endDragBefore(evt);
|
||||
DD._endDragAfter(evt);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user