From dd526b5581a159985e53faa2ceb43ae0bc3c3a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 4 Feb 2014 16:16:23 +0100 Subject: [PATCH] Simplify code in ol.render.Box#createGeometry_ --- src/ol/render/box.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ol/render/box.js b/src/ol/render/box.js index 143ef85c64..52f040a47d 100644 --- a/src/ol/render/box.js +++ b/src/ol/render/box.js @@ -69,14 +69,12 @@ ol.render.Box.prototype.createGeometry_ = function() { var startPixel = this.startPixel_; var endPixel = this.endPixel_; var pixels = [ - [ - startPixel, - [startPixel[0], endPixel[1]], - endPixel, - [endPixel[0], startPixel[1]] - ] + startPixel, + [startPixel[0], endPixel[1]], + endPixel, + [endPixel[0], startPixel[1]] ]; - var coordinates = goog.array.map(pixels[0], + var coordinates = goog.array.map(pixels, this.map_.getCoordinateFromPixel, this.map_); // close the polygon coordinates[4] = coordinates[0].slice();