You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
564 B
22 lines
564 B
/**
|
|
* @module ol/geom/flat/reverse
|
|
*/
|
|
|
|
/**
|
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
|
* @param {number} offset Offset.
|
|
* @param {number} end End.
|
|
* @param {number} stride Stride.
|
|
*/
|
|
export function coordinates(flatCoordinates, offset, end, stride) {
|
|
while (offset < end - stride) {
|
|
for (let i = 0; i < stride; ++i) {
|
|
const tmp = flatCoordinates[offset + i];
|
|
flatCoordinates[offset + i] = flatCoordinates[end - stride + i];
|
|
flatCoordinates[end - stride + i] = tmp;
|
|
}
|
|
offset += stride;
|
|
end -= stride;
|
|
}
|
|
}
|