Changeset 361

Show
Ignore:
Timestamp:
10/29/07 23:49:49 (1 year ago)
Author:
migurski
Message:

Fixed locationPoint by making Map.draw() non-destructive

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/py/ModestMaps/__init__.py

    r360 r361  
    1818def calculateMapCenter(provider, centerCoord): 
    1919    """ Based on a center coordinate, returns the coordinate 
    20         of an initial tile and it's point placement, relative to 
     20        of an initial tile and its point placement, relative to 
    2121        the map center. 
    2222    """ 
     
    209209        """ Draw map out to a PIL.Image and return it. 
    210210        """ 
     211        coord = self.coordinate.copy() 
    211212        corner = Core.Point(int(self.offset.x + self.dimensions.x/2), int(self.offset.y + self.dimensions.y/2)) 
    212213         
    213214        while corner.x > 0: 
    214215            corner.x -= self.provider.tileWidth() 
    215             self.coordinate = self.coordinate.left() 
     216            coord = coord.left() 
    216217         
    217218        while corner.y > 0: 
    218219            corner.y -= self.provider.tileHeight() 
    219             self.coordinate = self.coordinate.up() 
     220            coord = coord.up() 
    220221             
    221222        tiles = TileQueue() 
    222223         
    223         rowCoord = self.coordinate.copy() 
     224        rowCoord = coord.copy() 
    224225        for y in range(corner.y, self.dimensions.y, self.provider.tileHeight()): 
    225226            tileCoord = rowCoord.copy()