Using insertAt on a fixed Vector increases the length of the Vector over the fix length, as long as the index to insert to, is lower then the fixed size.
var test:Vector<Float> = new Vector<Float>(3,true);
test.insertAt(0, 1);
trace(test); //[1,0,0,0]
//shouldnt work, should it!?
//expected [1,0,0]
var test2:Vector<Float> = new Vector<Float>(3,true);
trace(test2); //[0,0,0]
test2.push(9); //error: cannot change length of vector
openfl.Vector:
public function insertAt (index:Int, element:T):Void {
if (!fixed || index < __array.length) {
__array.insert (index, element);
}
}
Is there a better way to keep n-values, except inserting and then splicing it myself !?