Browse files

Fix flex bug with dragEvent returning negative stageX/stageY. Fixes #…

…3613
  • Loading branch information...
1 parent 58c9d2c commit 3fdb3c2630ba015c7373cc511e8892b1fdd33c0c @gravitystorm gravitystorm committed Mar 29, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 potlatch2.mxml
View
5 potlatch2.mxml
@@ -434,7 +434,10 @@
// Get the tags
var tags:Array = event.dragSource.dataForFormat('tags') as Array;
- var mapLoc:Point = Globals.vars.root.globalToLocal(new Point(event.stageX, event.stageY));
+
+ // If you dnd quick enough, this exposes a flex bug and event.stageX/Y become negative.
+ // Take the mouse positions from a displayObject's stage for consistent results.
+ var mapLoc:Point = Globals.vars.root.globalToLocal(new Point(event.target.stage.mouseX, event.target.stage.mouseY));
var lat:Number = Globals.vars.root.coord2lat(mapLoc.y);
var lon:Number = Globals.vars.root.coord2lon(mapLoc.x);

0 comments on commit 3fdb3c2

Please sign in to comment.