mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 08:40:13 +08:00
discovered that the slow drag and drop behavior with Google Chrome is only effecting my Windows 7 test machine, not Mac. I've removed the drag and drop optimizing code for now
This commit is contained in:
parent
3a520376e5
commit
5e46018012
8
dist/kinetic-core.js
vendored
8
dist/kinetic-core.js
vendored
@ -46,7 +46,7 @@ Kinetic.GlobalObject = {
|
|||||||
animIdCounter: 0,
|
animIdCounter: 0,
|
||||||
dragTimeInterval: 0,
|
dragTimeInterval: 0,
|
||||||
maxDragTimeInterval: 20,
|
maxDragTimeInterval: 20,
|
||||||
isChrome: navigator.userAgent.toLowerCase().indexOf('chrome') > -1,
|
//isChrome: navigator.userAgent.toLowerCase().indexOf('chrome') > -1,
|
||||||
frame: {
|
frame: {
|
||||||
time: 0,
|
time: 0,
|
||||||
timeDiff: 0,
|
timeDiff: 0,
|
||||||
@ -1838,7 +1838,7 @@ Kinetic.Stage.prototype = {
|
|||||||
* For google chrome instances, dynamically set the dragTimeInterval
|
* For google chrome instances, dynamically set the dragTimeInterval
|
||||||
* to improve drag and drop performance while not effecting other browsers
|
* to improve drag and drop performance while not effecting other browsers
|
||||||
*/
|
*/
|
||||||
if(go.isChrome) {
|
//if(go.isChrome) {
|
||||||
/*
|
/*
|
||||||
* handle dynamice drag time interval. As the distance between
|
* handle dynamice drag time interval. As the distance between
|
||||||
* the mouse and cursor increases, we need to increase the drag
|
* the mouse and cursor increases, we need to increase the drag
|
||||||
@ -1847,11 +1847,13 @@ Kinetic.Stage.prototype = {
|
|||||||
* is zero, the time interval is zero. When the difference approahces
|
* is zero, the time interval is zero. When the difference approahces
|
||||||
* infinity, the time interval approaches the max drag time interval
|
* infinity, the time interval approaches the max drag time interval
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
var dragDiffX = Math.abs(newNodePos.x - node.attrs.x);
|
var dragDiffX = Math.abs(newNodePos.x - node.attrs.x);
|
||||||
var dragDiffY = Math.abs(newNodePos.y - node.attrs.y);
|
var dragDiffY = Math.abs(newNodePos.y - node.attrs.y);
|
||||||
var dragDiff = Math.sqrt(Math.pow(dragDiffX, 2) + Math.pow(dragDiffY, 2));
|
var dragDiff = Math.sqrt(Math.pow(dragDiffX, 2) + Math.pow(dragDiffY, 2));
|
||||||
go.dragTimeInterval = go.maxDragTimeInterval * (dragDiff - 1) / (dragDiff + 1);
|
go.dragTimeInterval = go.maxDragTimeInterval * (dragDiff - 1) / (dragDiff + 1);
|
||||||
}
|
*/
|
||||||
|
//}
|
||||||
|
|
||||||
// bounds overrides
|
// bounds overrides
|
||||||
if(db.left !== undefined && newNodePos.x < db.left) {
|
if(db.left !== undefined && newNodePos.x < db.left) {
|
||||||
|
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
@ -18,7 +18,7 @@ Kinetic.GlobalObject = {
|
|||||||
animIdCounter: 0,
|
animIdCounter: 0,
|
||||||
dragTimeInterval: 0,
|
dragTimeInterval: 0,
|
||||||
maxDragTimeInterval: 20,
|
maxDragTimeInterval: 20,
|
||||||
isChrome: navigator.userAgent.toLowerCase().indexOf('chrome') > -1,
|
//isChrome: navigator.userAgent.toLowerCase().indexOf('chrome') > -1,
|
||||||
frame: {
|
frame: {
|
||||||
time: 0,
|
time: 0,
|
||||||
timeDiff: 0,
|
timeDiff: 0,
|
||||||
|
@ -729,7 +729,7 @@ Kinetic.Stage.prototype = {
|
|||||||
* For google chrome instances, dynamically set the dragTimeInterval
|
* For google chrome instances, dynamically set the dragTimeInterval
|
||||||
* to improve drag and drop performance while not effecting other browsers
|
* to improve drag and drop performance while not effecting other browsers
|
||||||
*/
|
*/
|
||||||
if(go.isChrome) {
|
//if(go.isChrome) {
|
||||||
/*
|
/*
|
||||||
* handle dynamice drag time interval. As the distance between
|
* handle dynamice drag time interval. As the distance between
|
||||||
* the mouse and cursor increases, we need to increase the drag
|
* the mouse and cursor increases, we need to increase the drag
|
||||||
@ -738,11 +738,13 @@ Kinetic.Stage.prototype = {
|
|||||||
* is zero, the time interval is zero. When the difference approahces
|
* is zero, the time interval is zero. When the difference approahces
|
||||||
* infinity, the time interval approaches the max drag time interval
|
* infinity, the time interval approaches the max drag time interval
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
var dragDiffX = Math.abs(newNodePos.x - node.attrs.x);
|
var dragDiffX = Math.abs(newNodePos.x - node.attrs.x);
|
||||||
var dragDiffY = Math.abs(newNodePos.y - node.attrs.y);
|
var dragDiffY = Math.abs(newNodePos.y - node.attrs.y);
|
||||||
var dragDiff = Math.sqrt(Math.pow(dragDiffX, 2) + Math.pow(dragDiffY, 2));
|
var dragDiff = Math.sqrt(Math.pow(dragDiffX, 2) + Math.pow(dragDiffY, 2));
|
||||||
go.dragTimeInterval = go.maxDragTimeInterval * (dragDiff - 1) / (dragDiff + 1);
|
go.dragTimeInterval = go.maxDragTimeInterval * (dragDiff - 1) / (dragDiff + 1);
|
||||||
}
|
*/
|
||||||
|
//}
|
||||||
|
|
||||||
// bounds overrides
|
// bounds overrides
|
||||||
if(db.left !== undefined && newNodePos.x < db.left) {
|
if(db.left !== undefined && newNodePos.x < db.left) {
|
||||||
|
Loading…
Reference in New Issue
Block a user