Using new pos from return instead of by reference.

This commit is contained in:
David Johansson 2012-08-13 22:44:08 +02:00
parent 15fe79873c
commit aaeb49acf4
4 changed files with 5 additions and 3 deletions

View File

@ -1245,6 +1245,7 @@ requestAnimFrame = (function(callback) {
* @param {Number} [config.dragBounds.right]
* @param {Number} [config.dragBounds.bottom]
* @param {Number} [config.dragBounds.left]
* @param {Function} [config.dragBoundFunc] dragBoundFunc(pos, evt) should return new position
*/
Kinetic.Node = Kinetic.Class.extend({
init: function(config) {
@ -3539,7 +3540,7 @@ Kinetic.Stage = Kinetic.Container.extend({
if(dbf !== undefined) {
// execute dragBoundFunc if defined
dbf(newNodePos, evt);
newNodePos = dbf.call(node, newNodePos, evt);
}
// constraint overrides

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,7 @@
* @param {Number} [config.dragBounds.right]
* @param {Number} [config.dragBounds.bottom]
* @param {Number} [config.dragBounds.left]
* @param {Function} [config.dragBoundFunc] dragBoundFunc(pos, evt) should return new position
*/
Kinetic.Node = Kinetic.Class.extend({
init: function(config) {

View File

@ -815,7 +815,7 @@ Kinetic.Stage = Kinetic.Container.extend({
if(dbf !== undefined) {
// execute dragBoundFunc if defined
dbf(newNodePos, evt);
newNodePos = dbf.call(node, newNodePos, evt);
}
// constraint overrides