diff --git a/Source/Extras/Extras.js b/Source/Extras/Extras.js index 945247b..489f2d1 100644 --- a/Source/Extras/Extras.js +++ b/Source/Extras/Extras.js @@ -255,7 +255,7 @@ Extras.Classes.Events = new Class({ this.touchMoved = false; this.moved = false; - + this.lastPosition = false; }, setAsProperty: $.lambda(true), @@ -277,6 +277,7 @@ Extras.Classes.Events = new Class({ } this.pressed = this.moved = false; } + this.lastPosition = false; }, onMouseOut: function(e, win, event) { @@ -313,9 +314,16 @@ Extras.Classes.Events = new Class({ }, onMouseMove: function(e, win, event) { - var label, evt = $.event.get(e, win); + var label, evt = $.event.get(e, win), + // Check if mouse actually moved + didMove = this.lastPosition && this.mouseDidMove(e); + // Update last position to be current position for next time + this.lastPosition = { + x: e.clientX, + y: e.clientY + }; if(this.pressed) { - this.moved = true; + this.moved = didMove; this.config.onDragMove(this.pressed, event, evt); return; } @@ -388,6 +396,12 @@ Extras.Classes.Events = new Class({ } this.touched = this.touchMoved = false; } + }, + mouseDidMove: function(event) { + var deltaX = event.clientX - this.lastPosition.x, + deltaY = event.clientY - this.lastPosition.y, + movement = deltaX * deltaX + deltaY * deltaY; + return movement > 0; } }); diff --git a/Source/Graph/Graph.js b/Source/Graph/Graph.js index 76fd2a5..7750963 100644 --- a/Source/Graph/Graph.js +++ b/Source/Graph/Graph.js @@ -167,7 +167,7 @@ $jit.Graph = new Class({ this.nodes[obj.id] = new Graph.Node($.extend({ 'id': obj.id, 'name': obj.name, - 'data': $.merge(obj.data || {}, {}), + 'data': obj.data || {}, 'adjacencies': edges }, this.opt.Node), this.opt.klass, diff --git a/Source/Visualizations/Spacetree.js b/Source/Visualizations/Spacetree.js index a6e2fd8..31e52e7 100644 --- a/Source/Visualizations/Spacetree.js +++ b/Source/Visualizations/Spacetree.js @@ -1268,6 +1268,10 @@ $jit.ST.Label.DOM = new Class({ sy = canvas.scaleOffsetY, posx = pos.x * sx + ox, posy = pos.y * sy + oy; + + // Scale node width/height + w = w * sx; + h = h * sy; if(dim.align == "center") { labelPos= { diff --git a/web b/web deleted file mode 120000 index fce84a5..0000000 --- a/web +++ /dev/null @@ -1 +0,0 @@ -webpy/web \ No newline at end of file diff --git a/webpy/web/__init__.py b/web/__init__.py similarity index 100% rename from webpy/web/__init__.py rename to web/__init__.py diff --git a/webpy/web/application.py b/web/application.py old mode 100755 new mode 100644 similarity index 100% rename from webpy/web/application.py rename to web/application.py diff --git a/webpy/web/browser.py b/web/browser.py similarity index 100% rename from webpy/web/browser.py rename to web/browser.py diff --git a/webpy/web/contrib/__init__.py b/web/contrib/__init__.py similarity index 100% rename from webpy/web/contrib/__init__.py rename to web/contrib/__init__.py diff --git a/webpy/web/contrib/template.py b/web/contrib/template.py similarity index 100% rename from webpy/web/contrib/template.py rename to web/contrib/template.py diff --git a/webpy/web/db.py b/web/db.py similarity index 100% rename from webpy/web/db.py rename to web/db.py diff --git a/webpy/web/debugerror.py b/web/debugerror.py similarity index 100% rename from webpy/web/debugerror.py rename to web/debugerror.py diff --git a/webpy/web/form.py b/web/form.py similarity index 100% rename from webpy/web/form.py rename to web/form.py diff --git a/webpy/web/http.py b/web/http.py similarity index 100% rename from webpy/web/http.py rename to web/http.py diff --git a/webpy/web/httpserver.py b/web/httpserver.py similarity index 100% rename from webpy/web/httpserver.py rename to web/httpserver.py diff --git a/webpy/web/net.py b/web/net.py similarity index 100% rename from webpy/web/net.py rename to web/net.py diff --git a/webpy/web/session.py b/web/session.py similarity index 100% rename from webpy/web/session.py rename to web/session.py diff --git a/webpy/web/template.py b/web/template.py similarity index 100% rename from webpy/web/template.py rename to web/template.py diff --git a/webpy/web/test.py b/web/test.py similarity index 100% rename from webpy/web/test.py rename to web/test.py diff --git a/webpy/web/utils.py b/web/utils.py old mode 100755 new mode 100644 similarity index 100% rename from webpy/web/utils.py rename to web/utils.py diff --git a/webpy/web/webapi.py b/web/webapi.py similarity index 100% rename from webpy/web/webapi.py rename to web/webapi.py diff --git a/webpy/web/webopenid.py b/web/webopenid.py similarity index 100% rename from webpy/web/webopenid.py rename to web/webopenid.py diff --git a/webpy/web/wsgi.py b/web/wsgi.py similarity index 100% rename from webpy/web/wsgi.py rename to web/wsgi.py diff --git a/webpy/web/wsgiserver/LICENSE.txt b/web/wsgiserver/LICENSE.txt similarity index 100% rename from webpy/web/wsgiserver/LICENSE.txt rename to web/wsgiserver/LICENSE.txt diff --git a/webpy/web/wsgiserver/__init__.py b/web/wsgiserver/__init__.py similarity index 100% rename from webpy/web/wsgiserver/__init__.py rename to web/wsgiserver/__init__.py diff --git a/webpy/.gitignore b/webpy/.gitignore deleted file mode 100644 index d0a113f..0000000 --- a/webpy/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -.DS_Store \ No newline at end of file