OpenLayers OpenLayers

Changeset 2962

Show
Ignore:
Timestamp:
04/01/07 20:39:53 (2 years ago)
Author:
crschmidt
Message:

Resolve #609 with Schuyler looking over my shoulder for review. Instead of
always having a calculateOffset (which overwrites offset if it exists),
always have an offset. If people want calculateOffset, they can add it.
Reported by David Bitner.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Icon.js

    r2927 r2962  
    4141        this.url = url; 
    4242        this.size = (size) ? size : new OpenLayers.Size(20,20); 
    43         this.offset = offset; 
    44         this.calculateOffset = (calculateOffset) ? calculateOffset 
    45                                  : function(size) { 
    46                                      return new OpenLayers.Pixel(-(size.w/2),  
    47                                                                 -(size.h/2)); 
    48                                    }; 
     43        this.offset = offset ? offset : new OpenLayers.Pixel(-(size.w/2), -(size.h/2)); 
     44        this.calculateOffset = calculateOffset; 
    4945 
    5046        var id = OpenLayers.Util.createUniqueID("OL_Icon_");