mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 19:07:59 +08:00
cleaned up isAncestorOf logic. stage should not be an ancestor of self. plus this was bad OO design
This commit is contained in:
4
dist/kinetic-core.js
vendored
4
dist/kinetic-core.js
vendored
@@ -2586,10 +2586,6 @@ Kinetic.Container.prototype = {
|
|||||||
* @param {Kinetic.Node} node
|
* @param {Kinetic.Node} node
|
||||||
*/
|
*/
|
||||||
isAncestorOf: function(node) {
|
isAncestorOf: function(node) {
|
||||||
if(this.nodeType === 'Stage') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var parent = node.getParent();
|
var parent = node.getParent();
|
||||||
while(parent) {
|
while(parent) {
|
||||||
if(parent._id === this._id) {
|
if(parent._id === this._id) {
|
||||||
|
6
dist/kinetic-core.min.js
vendored
6
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -198,10 +198,6 @@ Kinetic.Container.prototype = {
|
|||||||
* @param {Kinetic.Node} node
|
* @param {Kinetic.Node} node
|
||||||
*/
|
*/
|
||||||
isAncestorOf: function(node) {
|
isAncestorOf: function(node) {
|
||||||
if(this.nodeType === 'Stage') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var parent = node.getParent();
|
var parent = node.getParent();
|
||||||
while(parent) {
|
while(parent) {
|
||||||
if(parent._id === this._id) {
|
if(parent._id === this._id) {
|
||||||
|
Reference in New Issue
Block a user