OpenLayers OpenLayers

Ticket #746: forgiveness.patch

File forgiveness.patch, 0.9 kB (added by euzuro, 1 year ago)

if no value passed in, set to 0

  • lib/OpenLayers/BaseTypes.js

    old new  
    118118    * @type OpenLayers.Pixel 
    119119    */ 
    120120    add:function(x, y) { 
     121        x = x || 0; 
     122        y = y || 0; 
    121123        return new OpenLayers.Pixel(this.x + x, this.y + y); 
    122124    }, 
    123125 
     
    279281    * @type OpenLayers.LonLat 
    280282    */ 
    281283    add:function(lon, lat) { 
     284        lon = lon || 0; 
     285        lat = lat || 0; 
    282286        return new OpenLayers.LonLat(this.lon + lon, this.lat + lat); 
    283287    }, 
    284288 
     
    478482    * @type OpenLayers.Bounds 
    479483    */ 
    480484    add:function(x, y) { 
     485        x = x || 0; 
     486        y = y || 0; 
    481487        return new OpenLayers.Bounds(this.left + x, this.bottom + y, 
    482488                                     this.right + x, this.top + y); 
    483489    },