Fix toolbox positioning
authorRichard Fairhurst <richard@systemeD.net>
Thu, 18 Oct 2012 17:15:49 +0000 (18:15 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Thu, 18 Oct 2012 17:15:49 +0000 (18:15 +0100)
/me is currently wondering what qualifies you to put "tech" at the start of your name

potlatch2.mxml

index ddd91d4..c9b2ce3 100644 (file)
                        }
                }
                private function suggestToolboxX():int {
-                       return theMap.localToGlobal(new Point(theMap.width,theMap.height)).x - toolbox.width - 5;
+                       var rhCP:Point=rhContent.localToGlobal(new Point(0,0));
+                       return rhCP.x + theMap.scrollRect.width - toolbox.width - 5;
                }
                private function suggestToolboxY(yOffset:int=0):int {
-                       return theMap.localToGlobal(new Point(theMap.width,theMap.height)).y - toolbox.height - 5 - yOffset;
+                       var rhCP:Point=rhContent.localToGlobal(new Point(0,0)); // stage co-ordinates of right-hand content area
+                       return rhCP.y + theMap.scrollRect.height - toolbox.height - 5 - yOffset;
                }
 
                private function disableMapMouse():void {