You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2015/01/07 13:30:31 UTC

[1/3] git commit: [flex-asjs] [refs/heads/develop] - Climb display list using FlexJS wrappers to perform coordinate conversion.

Repository: flex-asjs
Updated Branches:
  refs/heads/develop c375ffd25 -> c831a9ccb


Climb display list using FlexJS wrappers to perform coordinate conversion.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c59a9901
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c59a9901
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c59a9901

Branch: refs/heads/develop
Commit: c59a9901ee22542c2f5728af3e874e02f6955872
Parents: c375ffd
Author: Peter Ent <pe...@apache.org>
Authored: Wed Jan 7 07:29:17 2015 -0500
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Jan 7 07:29:17 2015 -0500

----------------------------------------------------------------------
 .../js/FlexJS/src/org/apache/flex/utils/PointUtils.js | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c59a9901/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
index 6b861f1..6c03884 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
@@ -49,7 +49,12 @@ org.apache.flex.utils.PointUtils.globalToLocal =
   do {
     x -= element.offsetLeft;
     y -= element.offsetTop;
-    element = element.offsetParent;
+    if (local.get_parent) {
+      local = local.get_parent();
+      element = local.element;
+    } else {
+      element = null;
+    }
   }
   while (element);
   return new org.apache.flex.geom.Point(x, y);
@@ -70,7 +75,12 @@ org.apache.flex.utils.PointUtils.localToGlobal =
   do {
     x += element.offsetLeft;
     y += element.offsetTop;
-    element = element.offsetParent;
+    if (local.get_parent) {
+      local = local.get_parent();
+      element = local.element;
+    } else {
+      element = null;
+    }
   }
   while (element);
   return new org.apache.flex.geom.Point(x, y);


[2/3] git commit: [flex-asjs] [refs/heads/develop] - Adjust ActionScript and JavaScript versions to produce like results.

Posted by pe...@apache.org.
Adjust ActionScript and JavaScript versions to produce like results.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e845c6e5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e845c6e5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e845c6e5

Branch: refs/heads/develop
Commit: e845c6e57460252b3315b6b9ec43ec9cc83cb532
Parents: c59a990
Author: Peter Ent <pe...@apache.org>
Authored: Wed Jan 7 07:29:52 2015 -0500
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Jan 7 07:29:52 2015 -0500

----------------------------------------------------------------------
 .../org/apache/flex/events/utils/MouseUtils.as  | 26 ++++++++++++++++++++
 .../org/apache/flex/events/utils/MouseUtils.js  | 20 ++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e845c6e5/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
index de2add3..f22d91c 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
@@ -73,5 +73,31 @@ package org.apache.flex.events.utils
 		{
 			return event.localY;
 		}
+		
+		/**
+		 *  Returns the globel X value.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		static public function globalX(event:MouseEvent):Number
+		{
+			return event.stageX;
+		}
+		
+		/**
+		 *  Returns the global Y value.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		static public function globalY(event:MouseEvent):Number
+		{
+			return event.stageY;
+		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e845c6e5/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js b/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
index 9ec27eb..4d8048d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
@@ -31,7 +31,7 @@ org.apache.flex.events.utils.MouseUtils.eventTarget = function(event) {
  * @return {number} The x position of the mouse with respect to its parent.
  */
 org.apache.flex.events.utils.MouseUtils.localX = function(event) {
-  return event.clientX;
+  return event.offsetX;
 };
 
 
@@ -40,5 +40,23 @@ org.apache.flex.events.utils.MouseUtils.localX = function(event) {
  * @return {number} The y position of the mouse with respect to its parent.
  */
 org.apache.flex.events.utils.MouseUtils.localY = function(event) {
+  return event.offsetY;
+};
+
+
+/**
+ * @param {Object} event The event.
+ * @return {number} The x position of the mouse with respect to the screen.
+ */
+org.apache.flex.events.utils.MouseUtils.globalX = function(event) {
+  return event.clientX;
+};
+
+
+/**
+ * @param {Object} event The event.
+ * @return {number} The y position of the mouse with respect to the screen.
+ */
+org.apache.flex.events.utils.MouseUtils.globalY = function(event) {
   return event.clientY;
 };


[3/3] git commit: [flex-asjs] [refs/heads/develop] - Update point determination code.

Posted by pe...@apache.org.
Update point determination code.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c831a9cc
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c831a9cc
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c831a9cc

Branch: refs/heads/develop
Commit: c831a9ccb74ed76fb149a3aaba415571fa8f23c2
Parents: e845c6e
Author: Peter Ent <pe...@apache.org>
Authored: Wed Jan 7 07:30:16 2015 -0500
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Jan 7 07:30:16 2015 -0500

----------------------------------------------------------------------
 .../FlexJSJX/src/org/apache/flex/charts/beads/DataTipBead.as     | 4 ++--
 .../FlexJSJX/src/org/apache/flex/html/accessories/ToolTipBead.as | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c831a9cc/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/DataTipBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/DataTipBead.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/DataTipBead.as
index 8725f2d..04f11ee 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/DataTipBead.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/DataTipBead.as
@@ -126,11 +126,11 @@ package org.apache.flex.charts.beads
 		 * Override's the ToolTipBead's function to position the data tip just above
 		 * the itemRenderer.
 		 */
-		override protected function determinePosition(base:Point, local:Object):Point
+		override protected function determinePosition(event:MouseEvent, base:Object):Point
 		{
 			// always want above the renderer
 			var pt:Point = new Point(0, -20);
-			pt = PointUtils.localToGlobal(pt, local);
+			pt = PointUtils.localToGlobal(pt, base);
 			return pt;
 		}
 		

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c831a9cc/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/ToolTipBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/ToolTipBead.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/ToolTipBead.as
index 64afbef..f005915 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/ToolTipBead.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/accessories/ToolTipBead.as
@@ -109,7 +109,7 @@ package org.apache.flex.html.accessories
 			
             tt = new ToolTip();
             tt.text = toolTip;
-            var pt:Point = determinePosition(new Point(MouseUtils.localX(event), MouseUtils.localY(event)), event.target);
+            var pt:Point = determinePosition(event, event.target);
             tt.x = pt.x;
             tt.y = pt.y;
             host.addElement(tt);
@@ -119,7 +119,7 @@ package org.apache.flex.html.accessories
 		 * @private
 		 * Determines the position of the toolTip.
 		 */
-		protected function determinePosition(base:Point, local:Object):Point
+		protected function determinePosition(event:MouseEvent, base:Object):Point
 		{
 			var comp:IUIBase = _strand as IUIBase;
 			var pt:Point = new Point(comp.width, comp.height);