Changeset 666

Show
Ignore:
Timestamp:
09/02/08 18:35:59 (3 months ago)
Author:
allens
Message:

made setSize() idempodent

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/as3/lib/com/modestmaps/Map.as

    r647 r666  
    331331            public function setSize(w:Number, h:Number):void 
    332332            { 
    333                 mapWidth = w; 
    334                 mapHeight = h; 
    335  
    336                 // mask out out of bounds marker remnants 
    337                 scrollRect = new Rectangle(0,0,mapWidth,mapHeight); 
    338                  
    339                 grid.resizeTo(new Point(mapWidth, mapHeight)); 
    340                  
    341                 dispatchEvent(new MapEvent(MapEvent.RESIZED, this.getSize()));           
     333                if (w != mapWidth || h != mapHeight) 
     334                { 
     335                mapWidth = w; 
     336                mapHeight = h; 
     337     
     338                // mask out out of bounds marker remnants 
     339                scrollRect = new Rectangle(0,0,mapWidth,mapHeight); 
     340                 
     341                grid.resizeTo(new Point(mapWidth, mapHeight)); 
     342                 
     343                dispatchEvent(new MapEvent(MapEvent.RESIZED, this.getSize())); 
     344            }            
    342345            } 
    343346