diff --git a/.gitignore b/.gitignore
index 5d2c6e0..bb2f415 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,5 @@ build.properties
*.iml
*.ipr
*.iws
-.idea/
\ No newline at end of file
+.idea/
+target/
\ No newline at end of file
diff --git a/.project b/.project
deleted file mode 100644
index d376ddf..0000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- Gestouch
-
-
-
-
-
- com.powerflasher.fdt.core.FlashBuilder
-
-
-
-
-
- com.powerflasher.fdt.core.FlashNature
-
-
diff --git a/.settings/com.powerflasher.fdt.classpath b/.settings/com.powerflasher.fdt.classpath
deleted file mode 100644
index 9292307..0000000
--- a/.settings/com.powerflasher.fdt.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- libs
- src
- frameworks/libs/air/airglobal.swc
- frameworks/libs/mobile/mobilecomponents.swc
- frameworks/libs/textLayout.swc
- frameworks/libs/framework.swc
- frameworks/libs/spark.swc
- frameworks/libs/sparkskins.swc
- frameworks/libs/air/servicemonitor.swc
- frameworks/themes/Mobile/mobile.swc
- frameworks/libs/mx/mx.swc
- libs/starling.swc
-
diff --git a/.settings/com.powerflasher.fdt.core.prefs b/.settings/com.powerflasher.fdt.core.prefs
deleted file mode 100644
index f2cc2b0..0000000
--- a/.settings/com.powerflasher.fdt.core.prefs
+++ /dev/null
@@ -1,15 +0,0 @@
-#Mon Apr 25 18:38:51 EEST 2011
-com.powerflasher.fdt.core.CompatiblePlayers=AIR_Debug_Launcher
-com.powerflasher.fdt.core.CompilerArguments=-load-config\="{flexSDK}/frameworks/airmobile-config.xml"\n-target-player\={playerVersion}\n-library-path+\="{flexSDK}/frameworks/locale/en_US"
-com.powerflasher.fdt.core.DefaultOutputFolder=bin
-com.powerflasher.fdt.core.DefaultPlayer=AIR_Debug_Launcher
-com.powerflasher.fdt.core.Language=AS3
-com.powerflasher.fdt.core.PassClasspath=true
-com.powerflasher.fdt.core.PassMainclass=true
-com.powerflasher.fdt.core.PassRsls=false
-com.powerflasher.fdt.core.PassSwcs=true
-com.powerflasher.fdt.core.PlayerVersion=10.2
-com.powerflasher.fdt.core.ProjectTypeHint=Flex 4.5 Mobile
-com.powerflasher.fdt.core.Runtime=AIR
-com.powerflasher.fdt.core.SdkName=Flex 4.5
-eclipse.preferences.version=1
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 2140b16..0000000
--- a/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun Apr 17 10:41:00 EEST 2011
-eclipse.preferences.version=1
-encoding/=UTF-8
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..753c289
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,229 @@
+
+
+ 4.0.0
+
+ org.gestouch
+ gestouch
+ swc
+ 0.4.7
+
+
+ 5.0-beta
+ 4.6.b.23201
+
+
+
+
+ jenkins
+ https://fljot.ci.cloudbees.com/job/Gestouch/
+
+
+
+ github
+ https://github.com/fljot/Gestouch/issues
+
+
+
+
+ https://github.com/fljot/Gestouch
+ scm:git:ssh://git@github.com:fljot/Gestouch.git
+ scm:git:ssh://git@github.com:fljot/Gestouch.git
+
+
+
+ src/
+
+
+
+ net.flexmojos.oss
+ flexmojos-maven-plugin
+ ${flexmojos.version}
+ true
+
+ true
+
+ true
+ true
+ true
+ true
+
+
+
+ Abstract
+
+
+
+
+ com.adobe.flex
+ compiler
+ ${flex.sdk.version}
+ pom
+
+
+
+
+
+ net.flexmojos.oss
+ flexmojos-maven-plugin
+
+
+ prepare-package
+
+ asdoc
+
+
+
+
+
+ true
+ true
+ Gestouch ${project.version}
+ Gestouch ${project.version}
+
+
+
+
+
+ maven-antrun-plugin
+ 1.7
+
+
+ fail-to-deploy-in-develop
+ package
+
+
+
+
+
+
+
+
+
+
+
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.sonatype.flexmojos
+ flexmojos-maven-plugin
+ ${flexmojos.version}
+
+
+ flex-reports
+
+ asdoc-report
+
+
+
+
+
+
+
+
+
+ com.adobe.flex
+ compiler
+ ${flex.sdk.version}
+ pom
+
+
+
+ com.adobe.flex.framework
+ flex-framework
+ ${flex.sdk.version}
+ pom
+ provided
+
+
+
+ com.gamua
+ starling-framework
+ [1.1,]
+ swc
+
+
+
+
+
+ flex-mojos-repository
+ http://repository.sonatype.org/content/groups/flexgroup
+
+
+
+ starling-repository
+ http://repository-trylogic.forge.cloudbees.com/snapshot
+
+ false
+
+
+ true
+
+
+
+
+
+
+ flex-mojos-plugin-repository
+ http://repository.sonatype.org/content/groups/flexgroup
+
+ true
+ never
+
+
+ false
+ never
+
+
+
+
+
+
+ Pavel fljōt Pevnitskiy
+ pavel.fljot at gmail.com
+
+
+
diff --git a/src/org/gestouch/core/GesturesManager.as b/src/org/gestouch/core/GesturesManager.as
index 67c8251..497586d 100644
--- a/src/org/gestouch/core/GesturesManager.as
+++ b/src/org/gestouch/core/GesturesManager.as
@@ -20,7 +20,6 @@ package org.gestouch.core
public class GesturesManager
{
protected const _frameTickerShape:Shape = new Shape();
- protected var _inputAdapters:Vector. = new Vector.();
protected var _gesturesMap:Dictionary = new Dictionary(true);
protected var _gesturesForTouchMap:Dictionary = new Dictionary();
protected var _gesturesForTargetMap:Dictionary = new Dictionary(true);
@@ -182,9 +181,9 @@ package org.gestouch.core
if (gesture.canPreventGesture(otherGesture) &&
otherGesture.canBePreventedByGesture(gesture) &&
(gesture.gesturesShouldRecognizeSimultaneouslyCallback == null ||
- gesture.gesturesShouldRecognizeSimultaneouslyCallback(gesture, otherGesture)) &&
+ !gesture.gesturesShouldRecognizeSimultaneouslyCallback(gesture, otherGesture)) &&
(otherGesture.gesturesShouldRecognizeSimultaneouslyCallback == null ||
- otherGesture.gesturesShouldRecognizeSimultaneouslyCallback(otherGesture, gesture)))
+ !otherGesture.gesturesShouldRecognizeSimultaneouslyCallback(otherGesture, gesture)))
{
otherGesture.setState_internal(GestureState.FAILED);
}
diff --git a/src/org/gestouch/core/Touch.as b/src/org/gestouch/core/Touch.as
index c4d9440..b738a4a 100644
--- a/src/org/gestouch/core/Touch.as
+++ b/src/org/gestouch/core/Touch.as
@@ -116,8 +116,8 @@ package org.gestouch.core
public function clone():Touch
{
var touch:Touch = new Touch(id);
- touch._location = _location;
- touch._beginLocation = _beginLocation;
+ touch._location = _location.clone();
+ touch._beginLocation = _beginLocation.clone();
touch.target = target;
touch.sizeX = sizeX;
touch.sizeY = sizeY;
diff --git a/src/org/gestouch/gestures/Gesture.as b/src/org/gestouch/gestures/Gesture.as
index 9a614ac..83ad313 100644
--- a/src/org/gestouch/gestures/Gesture.as
+++ b/src/org/gestouch/gestures/Gesture.as
@@ -91,8 +91,6 @@ package org.gestouch.gestures
protected var _gesturesToFail:Dictionary = new Dictionary(true);
protected var _pendingRecognizedState:GestureState;
- private var eventListeners:Dictionary = new Dictionary();
-
public function Gesture(target:Object = null)
{
@@ -223,43 +221,6 @@ package org.gestouch.gestures
//
//--------------------------------------------------------------------------
- override public function addEventListener(type:String, listener:Function,
- useCapture:Boolean = false, priority:int = 0,
- useWeakReference:Boolean = false):void
- {
- super.addEventListener(type, listener, useCapture, priority, useWeakReference);
-
- const listenerProps:Array = eventListeners[listener] as Array;
- if (listenerProps)
- {
- listenerProps.push(type, useCapture);
- }
- else
- {
- eventListeners[listener] = [type, useCapture];
- }
- }
-
-
- public function removeAllEventListeners():void
- {
- for (var listener:Object in eventListeners)
- {
- const listenerProps:Array = eventListeners[listener] as Array;
-
- var n:uint = listenerProps.length;
- for (var i:uint = 0; i < n;)
- {
- super.removeEventListener(listenerProps[i++] as String, listener as Function, listenerProps[i++] as Boolean);
- }
-
- delete eventListeners[listener];
- }
-
-// eventListeners = new Dictionary(true);
- }
-
-
[Abstract]
/**
* Reflects gesture class (for better perfomance).
@@ -336,13 +297,11 @@ package org.gestouch.gestures
{
//TODO
reset();
- removeAllEventListeners();
target = null;
gestureShouldReceiveTouchCallback = null;
gestureShouldBeginCallback = null;
gesturesShouldRecognizeSimultaneouslyCallback = null;
_gesturesToFail = null;
- eventListeners = null;
}
diff --git a/src/org/gestouch/gestures/RotateGesture.as b/src/org/gestouch/gestures/RotateGesture.as
index 5d99900..e53eb19 100644
--- a/src/org/gestouch/gestures/RotateGesture.as
+++ b/src/org/gestouch/gestures/RotateGesture.as
@@ -87,7 +87,9 @@ package org.gestouch.gestures
return;
var currTransformVector:Point = _touch2.location.subtract(_touch1.location);
- var rotation:Number = Math.atan2(currTransformVector.y, currTransformVector.x) - Math.atan2(_transformVector.y, _transformVector.x);
+ var cross:Number = (_transformVector.x * currTransformVector.y) - (currTransformVector.x * _transformVector.y);
+ var dot:Number = (_transformVector.x * currTransformVector.x) + (_transformVector.y * currTransformVector.y);
+ var rotation:Number = Math.atan2(cross, dot);
if (state == GestureState.POSSIBLE)
{