From f40bde004bd73e38d5a82b0505333896e7a23253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toms=20Bau=C4=A3is?= Date: Sat, 30 May 2015 16:13:55 +0100 Subject: [PATCH 1/2] update example so that it respects the drag start --- tutorials/Mouse Interaction/drag.html | 33 +++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/tutorials/Mouse Interaction/drag.html b/tutorials/Mouse Interaction/drag.html index 42db0e622..80641f396 100644 --- a/tutorials/Mouse Interaction/drag.html +++ b/tutorials/Mouse Interaction/drag.html @@ -1,3 +1,4 @@ + @@ -6,34 +7,42 @@ @@ -43,4 +52,4 @@ alternate content - \ No newline at end of file + From 4463d7da329e375de8a91610554b2cd2b62a021f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toms=20Bau=C4=A3is?= Date: Sat, 30 May 2015 16:17:36 +0100 Subject: [PATCH 2/2] tabs -> spaces in example code --- tutorials/Mouse Interaction/drag.html | 68 +++++++++++++-------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tutorials/Mouse Interaction/drag.html b/tutorials/Mouse Interaction/drag.html index 80641f396..c538391ae 100644 --- a/tutorials/Mouse Interaction/drag.html +++ b/tutorials/Mouse Interaction/drag.html @@ -2,32 +2,32 @@ - EaselJS demo: Dragging - - - + + dragger.on("pressmove",function(evt) { + // currentTarget will be the container that the event listener was added to: + evt.currentTarget.x = evt.stageX - evt.currentTarget.dragOffset.x; + evt.currentTarget.y = evt.stageY - evt.currentTarget.dragOffset.y; + // make sure to redraw the stage to show the change: + stage.update(); + }); + + stage.update(); + } + - - alternate content - + + alternate content +