mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 20:58:15 +00:00
[Plot] Fix insertion in PlotLineBuffer
WTD-806.
This commit is contained in:
@ -131,8 +131,8 @@ define(
|
|||||||
// Shift data over if necessary
|
// Shift data over if necessary
|
||||||
if (index < length) {
|
if (index < length) {
|
||||||
buffer.set(
|
buffer.set(
|
||||||
buffer.subarray(index, length - index),
|
buffer.subarray(index * 2, length * 2),
|
||||||
index + sz
|
(index + sz) * 2
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,14 @@ define(
|
|||||||
expect(buffer.findInsertionIndex(9)).toEqual(-1);
|
expect(buffer.findInsertionIndex(9)).toEqual(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("allows insertion in the middle", function () {
|
||||||
|
var head = [ -41, 8, -39, 0, -35, 3 ],
|
||||||
|
tail = [ -33, 9, -28, 8, -27, 11];
|
||||||
|
buffer.insert(mockSeries, 3);
|
||||||
|
expect(
|
||||||
|
Array.prototype.slice.call(buffer.getBuffer()).slice(0, 24)
|
||||||
|
).toEqual(head.concat(head).concat(tail).concat(tail));
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user