add a static function to make a Bounds from a Size. test included.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@531 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -490,6 +490,23 @@ OpenLayers.Bounds.fromArray = function(bbox) {
|
||||
parseFloat(bbox[3]));
|
||||
};
|
||||
|
||||
/** Alternative constructor that builds a new OpenLayers.Bounds
|
||||
* from an OpenLayers.Size
|
||||
*
|
||||
* @constructor
|
||||
*
|
||||
* @param {OpenLayers.Size} size
|
||||
*
|
||||
* @returns New OpenLayers.Bounds object built with top and left set to 0 and
|
||||
* bottom right taken from the passed-in OpenLayers.Size.
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
OpenLayers.Bounds.fromSize = function(size) {
|
||||
return new OpenLayers.Bounds(0,
|
||||
size.h,
|
||||
size.w,
|
||||
0);
|
||||
};
|
||||
/**
|
||||
* @param {String} quadrant
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user