Correctly set default anchor for collections

This commit is contained in:
Tim Schaub
2016-08-04 11:27:36 -06:00
parent 795cee876e
commit 69bf9254a5
4 changed files with 104 additions and 1 deletions

View File

@@ -249,9 +249,13 @@ ol.geom.GeometryCollection.prototype.rotate = function(angle, anchor) {
* @api
*/
ol.geom.GeometryCollection.prototype.scale = function(sx, opt_sy, opt_anchor) {
var anchor = opt_anchor;
if (!anchor) {
anchor = ol.extent.getCenter(this.getExtent());
}
var geometries = this.geometries_;
for (var i = 0, ii = geometries.length; i < ii; ++i) {
geometries[i].scale(sx, opt_sy, opt_anchor);
geometries[i].scale(sx, opt_sy, anchor);
}
this.changed();
};