mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 00:36:20 +08:00
fixed drag and drop issue and reverted default easing back to linear
This commit is contained in:
parent
3a8afc747c
commit
71b0449071
13
dist/kinetic-core.js
vendored
13
dist/kinetic-core.js
vendored
@ -137,7 +137,7 @@ Kinetic.GlobalObject = {
|
|||||||
return 2.5 + b * transition.time;
|
return 2.5 + b * transition.time;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
// none is default
|
// linear is default
|
||||||
default:
|
default:
|
||||||
this._transitionPow(transition, key, prop, function() {
|
this._transitionPow(transition, key, prop, function() {
|
||||||
return 1;
|
return 1;
|
||||||
@ -628,7 +628,7 @@ Kinetic.Node.prototype = {
|
|||||||
*/
|
*/
|
||||||
draggable: function(isDraggable) {
|
draggable: function(isDraggable) {
|
||||||
if(this.draggable !== isDraggable) {
|
if(this.draggable !== isDraggable) {
|
||||||
if(isDraggable && this.isDragging()) {
|
if(isDraggable) {
|
||||||
this._initDrag();
|
this._initDrag();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -721,8 +721,8 @@ Kinetic.Node.prototype = {
|
|||||||
* radius, scale.x, scale.y, centerOffset.x, centerOffset.y, etc.
|
* radius, scale.x, scale.y, centerOffset.x, centerOffset.y, etc.
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
* @config {Number} [duration] duration that the transition runs in seconds
|
* @config {Number} [duration] duration that the transition runs in seconds
|
||||||
* @config {String} [easing] easing function. can be none, ease-in, ease-out, or ease-in-out.
|
* @config {String} [easing] easing function. can be linear, ease-in, ease-out, or ease-in-out.
|
||||||
* none is the default
|
* linear is the default
|
||||||
* @config {Function} [callback] callback function to be executed when
|
* @config {Function} [callback] callback function to be executed when
|
||||||
* transition completes
|
* transition completes
|
||||||
*/
|
*/
|
||||||
@ -848,6 +848,7 @@ Kinetic.Node.prototype = {
|
|||||||
* initialize drag and drop
|
* initialize drag and drop
|
||||||
*/
|
*/
|
||||||
_initDrag: function() {
|
_initDrag: function() {
|
||||||
|
this._dragCleanup();
|
||||||
var go = Kinetic.GlobalObject;
|
var go = Kinetic.GlobalObject;
|
||||||
var that = this;
|
var that = this;
|
||||||
this.on('mousedown.initdrag touchstart.initdrag', function(evt) {
|
this.on('mousedown.initdrag touchstart.initdrag', function(evt) {
|
||||||
@ -1926,9 +1927,7 @@ Kinetic.Shape = function(config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config.detectionType === undefined) {
|
this.detectionType = 'path';
|
||||||
config.detectionType = 'path';
|
|
||||||
}
|
|
||||||
|
|
||||||
// required
|
// required
|
||||||
this.drawFunc = config.drawFunc;
|
this.drawFunc = config.drawFunc;
|
||||||
|
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -109,7 +109,7 @@ Kinetic.GlobalObject = {
|
|||||||
return 2.5 + b * transition.time;
|
return 2.5 + b * transition.time;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
// none is default
|
// linear is default
|
||||||
default:
|
default:
|
||||||
this._transitionPow(transition, key, prop, function() {
|
this._transitionPow(transition, key, prop, function() {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -381,7 +381,7 @@ Kinetic.Node.prototype = {
|
|||||||
*/
|
*/
|
||||||
draggable: function(isDraggable) {
|
draggable: function(isDraggable) {
|
||||||
if(this.draggable !== isDraggable) {
|
if(this.draggable !== isDraggable) {
|
||||||
if(isDraggable && this.isDragging()) {
|
if(isDraggable) {
|
||||||
this._initDrag();
|
this._initDrag();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -474,8 +474,8 @@ Kinetic.Node.prototype = {
|
|||||||
* radius, scale.x, scale.y, centerOffset.x, centerOffset.y, etc.
|
* radius, scale.x, scale.y, centerOffset.x, centerOffset.y, etc.
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
* @config {Number} [duration] duration that the transition runs in seconds
|
* @config {Number} [duration] duration that the transition runs in seconds
|
||||||
* @config {String} [easing] easing function. can be none, ease-in, ease-out, or ease-in-out.
|
* @config {String} [easing] easing function. can be linear, ease-in, ease-out, or ease-in-out.
|
||||||
* none is the default
|
* linear is the default
|
||||||
* @config {Function} [callback] callback function to be executed when
|
* @config {Function} [callback] callback function to be executed when
|
||||||
* transition completes
|
* transition completes
|
||||||
*/
|
*/
|
||||||
@ -601,6 +601,7 @@ Kinetic.Node.prototype = {
|
|||||||
* initialize drag and drop
|
* initialize drag and drop
|
||||||
*/
|
*/
|
||||||
_initDrag: function() {
|
_initDrag: function() {
|
||||||
|
this._dragCleanup();
|
||||||
var go = Kinetic.GlobalObject;
|
var go = Kinetic.GlobalObject;
|
||||||
var that = this;
|
var that = this;
|
||||||
this.on('mousedown.initdrag touchstart.initdrag', function(evt) {
|
this.on('mousedown.initdrag touchstart.initdrag', function(evt) {
|
||||||
|
@ -28,9 +28,7 @@ Kinetic.Shape = function(config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config.detectionType === undefined) {
|
this.detectionType = 'path';
|
||||||
config.detectionType = 'path';
|
|
||||||
}
|
|
||||||
|
|
||||||
// required
|
// required
|
||||||
this.drawFunc = config.drawFunc;
|
this.drawFunc = config.drawFunc;
|
||||||
|
@ -1052,14 +1052,6 @@ Test.prototype.tests = {
|
|||||||
|
|
||||||
circle.draggable(true);
|
circle.draggable(true);
|
||||||
circle.draggable(true);
|
circle.draggable(true);
|
||||||
circle.draggable(true);
|
|
||||||
circle.draggable(false);
|
|
||||||
|
|
||||||
circle.draggable(true);
|
|
||||||
circle.draggable(true);
|
|
||||||
circle.draggable(true);
|
|
||||||
|
|
||||||
// circle should not be draggable
|
|
||||||
circle.draggable(false);
|
circle.draggable(false);
|
||||||
|
|
||||||
layer.add(circle);
|
layer.add(circle);
|
||||||
|
Loading…
Reference in New Issue
Block a user