flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [02/12] git commit: [flex-asjs] [refs/heads/develop] - fix drag image positioning
Date Mon, 12 Jan 2015 18:50:54 GMT
fix drag image positioning


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

Branch: refs/heads/develop
Commit: 155ebec70dada799dfef16fb7db9c98df99ac5ee
Parents: 8b0eeb6
Author: Alex Harui <aharui@apache.org>
Authored: Mon Jan 12 10:44:02 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Jan 12 10:44:02 2015 -0800

----------------------------------------------------------------------
 .../src/productsView/ProductCatalogThumbnail.mxml         |  4 +---
 .../flex/html/beads/controllers/DragMouseController.as    | 10 ++++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/155ebec7/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml b/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
index 6769706..f7a0ea4 100755
--- a/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
+++ b/examples/FlexJSStore/src/productsView/ProductCatalogThumbnail.mxml
@@ -91,9 +91,7 @@ limitations under the License.
                 event.target != compare &&
                 event.target != details)
             {
-                dragStartPoint = new Point(event.screenX, event.screenY);
-                dragStartPoint = PointUtils.globalToLocal(dragStartPoint, this);
-
+                dragStartPoint = new Point(event.clientX, event.clientY);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/155ebec7/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
index 7f439a5..01351b8 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
@@ -87,7 +87,7 @@ package org.apache.flex.html.beads.controllers
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-        public static var dragging:Boolean;
+        public static var dragging:Boolean = false;
         
         /**
          *  The drag image.
@@ -216,7 +216,7 @@ package org.apache.flex.html.beads.controllers
                         dragging = true;
                         host = UIUtils.findPopUpHost(_strand as IUIBase);
                         host.addElement(dragImage);
-                        pt = PointUtils.globalToLocal(new Point(event.screenX, event.screenY),
host);
+                        pt = PointUtils.globalToLocal(new Point(event.clientX, event.clientY),
host);
                         dragImage.x = pt.x + dragImageOffsetX;
                         dragImage.y = pt.y + dragImageOffsetY;
                     }
@@ -224,9 +224,11 @@ package org.apache.flex.html.beads.controllers
             }
             else
             {
-                trace("sending dragMove", event.target);
+                trace("sending dragMove " + event.target.toString());
                 dragEvent = DragEvent.createDragEvent("dragMove", event);
-                pt = PointUtils.globalToLocal(new Point(event.screenX, event.screenY), host);
+                trace("client: " + event.clientX.toString() + " " + event.clientY.toString()
+ " " + event.target.toString());
+                pt = PointUtils.globalToLocal(new Point(event.clientX, event.clientY), host);
+                trace("host: " + pt.x.toString() + " " + pt.y.toString());
                 dragImage.x = pt.x + dragImageOffsetX;
                 dragImage.y = pt.y + dragImageOffsetY;
                 DragEvent.dispatchDragEvent(dragEvent, IEventDispatcher(event.target));


Mime
View raw message