# all files / ol/geom/flat/ reverseflatgeom.js

100% Statements 10/10
100% Branches 0/0
100% Functions 1/1
100% Lines 10/10

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    221×

    1×
    80×
    130×
    130×
    296×
    296×
    296×

    130×
    130×

     goog.provide('ol.geom.flat.reverse');

    /**
     * @param {Array.<number>} flatCoordinates Flat coordinates.
     * @param {number} offset Offset.
     * @param {number} end End.
     * @param {number} stride Stride.
     */
    ol.geom.flat.reverse.coordinates = function(flatCoordinates, offset, end, stride) {
      while (offset < end - stride) {
        var i;
        for (i = 0; i < stride; ++i) {
          var tmp = flatCoordinates[offset + i];
          flatCoordinates[offset + i] = flatCoordinates[end - stride + i];
          flatCoordinates[end - stride + i] = tmp;
        }
        offset += stride;
        end -= stride;
      }
    };