void add(final float x, final float y) { if (size == this.x.length) ensureCapacity(size + 16); this.x[size] = x; this.y[size] = y; size++; }
@Override public void ensureCapacity(final int capacity) { vertices.ensureCapacity(capacity); }
void close() { // // If we have a single value, duplicate it for closing // if (size == 1) { // ensureCapacity(2); // x[size] = this.x[0]; // y[size] = this.y[0]; // size++; // } // else if (size > 1) { if (x[0] != x[size-1] || y[0] != y[size-1]) { ensureCapacity(size+1); x[size] = this.x[0]; y[size] = this.y[0]; size++; } } compact(); }