Changeset 598

Show
Ignore:
Timestamp:
07/09/08 11:36:51 (2 months ago)
Author:
allens
Message:

allow for null context in pointCoordinate() and coordinatePoint()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/tom-tweenlite/lib/com/modestmaps/core/MapExtent.as

    r588 r598  
    158158                        var first:Location = locations[0] as Location; 
    159159                        var extent:MapExtent = new MapExtent(first.lat, first.lat, first.lon, first.lon); 
    160                         for (var i:int = 1; i < locations.length; i++) { 
     160                        for (var i:int = 1; i < locations.length; i++) 
     161                        { 
    161162                                extent.enclose(locations[i]); 
    162163                        } 
  • branches/tom-tweenlite/lib/com/modestmaps/core/TileGrid.as

    r597 r598  
    825825                        var screenPoint:Point = new Point(mapWidth * (zoomedColumn-tl.column) / cols, mapHeight * (zoomedRow-tl.row) / rows); 
    826826 
    827                         if (!context) context = this; 
    828                         screenPoint = this.parent.localToGlobal(screenPoint); 
    829                         screenPoint = context.globalToLocal(screenPoint); 
     827                        if (context && context != this) 
     828            { 
     829                        screenPoint = this.parent.localToGlobal(screenPoint); 
     830                        screenPoint = context.globalToLocal(screenPoint); 
     831            } 
    830832 
    831833                        return screenPoint;  
     
    833835                public function pointCoordinate(point:Point, context:DisplayObject=null):Coordinate 
    834836                {                        
    835                         if (!context) context = this; 
    836                         point = context.localToGlobal(point); 
    837                         point = this.globalToLocal(point); 
     837                        if (context && context != this) 
     838            { 
     839                        point = context.localToGlobal(point); 
     840                        point = this.globalToLocal(point); 
     841            } 
    838842                         
    839843                        var p:Point = invertedMatrix.transformPoint(point);