mirror of
https://github.com/konvajs/konva.git
synced 2025-06-27 19:25:43 +08:00
code cleanup
This commit is contained in:
parent
8aa5fcf560
commit
d10721d85a
25
dist/kinetic-core.js
vendored
25
dist/kinetic-core.js
vendored
@ -3,7 +3,7 @@
|
|||||||
* http://www.kineticjs.com/
|
* http://www.kineticjs.com/
|
||||||
* Copyright 2012, Eric Rowell
|
* Copyright 2012, Eric Rowell
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: Mar 20 2012
|
* Date: Mar 21 2012
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||||
*
|
*
|
||||||
@ -1549,6 +1549,18 @@ Kinetic.Stage.prototype = {
|
|||||||
}
|
}
|
||||||
go.drag.node = undefined;
|
go.drag.node = undefined;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* get adusted component based on parent scales
|
||||||
|
*/
|
||||||
|
_getAdjustedComponent: function(node, val, prop) {
|
||||||
|
var parent = node.parent;
|
||||||
|
var adj = 1;
|
||||||
|
while(parent.className !== 'Stage') {
|
||||||
|
adj /= parent.scale[prop];
|
||||||
|
parent = parent.parent;
|
||||||
|
}
|
||||||
|
return adj * val;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* prepare drag and drop
|
* prepare drag and drop
|
||||||
*/
|
*/
|
||||||
@ -1704,17 +1716,6 @@ Kinetic.Layer.prototype = {
|
|||||||
if(this.visible) {
|
if(this.visible) {
|
||||||
this._drawChildren();
|
this._drawChildren();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
/**
|
|
||||||
* clear transition if one is running
|
|
||||||
*/
|
|
||||||
_clearTransition: function(node) {
|
|
||||||
for(var n = 0; n < this.transitions.length; n++) {
|
|
||||||
var transition = this.transitions[n];
|
|
||||||
if(transition.node.id === node.id) {
|
|
||||||
Kinetic.GlobalObject._removeTransition(transition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Extend Container and Node
|
// Extend Container and Node
|
||||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
11
src/Layer.js
11
src/Layer.js
@ -73,17 +73,6 @@ Kinetic.Layer.prototype = {
|
|||||||
if(this.visible) {
|
if(this.visible) {
|
||||||
this._drawChildren();
|
this._drawChildren();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
/**
|
|
||||||
* clear transition if one is running
|
|
||||||
*/
|
|
||||||
_clearTransition: function(node) {
|
|
||||||
for(var n = 0; n < this.transitions.length; n++) {
|
|
||||||
var transition = this.transitions[n];
|
|
||||||
if(transition.node.id === node.id) {
|
|
||||||
Kinetic.GlobalObject._removeTransition(transition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Extend Container and Node
|
// Extend Container and Node
|
||||||
|
12
src/Stage.js
12
src/Stage.js
@ -610,6 +610,18 @@ Kinetic.Stage.prototype = {
|
|||||||
}
|
}
|
||||||
go.drag.node = undefined;
|
go.drag.node = undefined;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* get adusted component based on parent scales
|
||||||
|
*/
|
||||||
|
_getAdjustedComponent: function(node, val, prop) {
|
||||||
|
var parent = node.parent;
|
||||||
|
var adj = 1;
|
||||||
|
while(parent.className !== 'Stage') {
|
||||||
|
adj /= parent.scale[prop];
|
||||||
|
parent = parent.parent;
|
||||||
|
}
|
||||||
|
return adj * val;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* prepare drag and drop
|
* prepare drag and drop
|
||||||
*/
|
*/
|
||||||
|
@ -10,7 +10,7 @@ function log(message) {
|
|||||||
* Test constructor
|
* Test constructor
|
||||||
*/
|
*/
|
||||||
function Test() {
|
function Test() {
|
||||||
this.testOnly = 'TRANSITION - ease-in, ease-out, ease-in-out hovers';
|
this.testOnly = '';
|
||||||
this.counter = 0;
|
this.counter = 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -257,7 +257,7 @@ Test.prototype.tests = {
|
|||||||
this.transitionTo({
|
this.transitionTo({
|
||||||
scale: {
|
scale: {
|
||||||
x: 1.5,
|
x: 1.5,
|
||||||
y: 1.5
|
y: 1.5
|
||||||
},
|
},
|
||||||
duration: 1,
|
duration: 1,
|
||||||
easing: easing
|
easing: easing
|
||||||
|
Loading…
Reference in New Issue
Block a user