(float x, float y)
| 743 | |
| 744 | |
| 745 | @Override |
| 746 | public void vertex(float x, float y) { |
| 747 | curveVertexCount = 0; |
| 748 | //float vertex[]; |
| 749 | |
| 750 | if (vertexCount == vertices.length) { |
| 751 | float[][] temp = new float[vertexCount<<1][VERTEX_FIELD_COUNT]; |
| 752 | System.arraycopy(vertices, 0, temp, 0, vertexCount); |
| 753 | vertices = temp; |
| 754 | //message(CHATTER, "allocating more vertices " + vertices.length); |
| 755 | } |
| 756 | // not everyone needs this, but just easier to store rather |
| 757 | // than adding another moving part to the code... |
| 758 | vertices[vertexCount][X] = x; |
| 759 | vertices[vertexCount][Y] = y; |
| 760 | vertexCount++; |
| 761 | |
| 762 | switch (shape) { |
| 763 | |
| 764 | case POINTS: |
| 765 | point(x, y); |
| 766 | break; |
| 767 | |
| 768 | case LINES: |
| 769 | if ((vertexCount % 2) == 0) { |
| 770 | line(vertices[vertexCount-2][X], |
| 771 | vertices[vertexCount-2][Y], x, y); |
| 772 | } |
| 773 | break; |
| 774 | |
| 775 | case TRIANGLES: |
| 776 | if ((vertexCount % 3) == 0) { |
| 777 | triangle(vertices[vertexCount - 3][X], |
| 778 | vertices[vertexCount - 3][Y], |
| 779 | vertices[vertexCount - 2][X], |
| 780 | vertices[vertexCount - 2][Y], |
| 781 | x, y); |
| 782 | } |
| 783 | break; |
| 784 | |
| 785 | case TRIANGLE_STRIP: |
| 786 | if (vertexCount >= 3) { |
| 787 | triangle(vertices[vertexCount - 2][X], |
| 788 | vertices[vertexCount - 2][Y], |
| 789 | vertices[vertexCount - 1][X], |
| 790 | vertices[vertexCount - 1][Y], |
| 791 | vertices[vertexCount - 3][X], |
| 792 | vertices[vertexCount - 3][Y]); |
| 793 | } |
| 794 | break; |
| 795 | |
| 796 | case TRIANGLE_FAN: |
| 797 | if (vertexCount >= 3) { |
| 798 | // This is an unfortunate implementation because the stroke for an |
| 799 | // adjacent triangle will be repeated. However, if the stroke is not |
| 800 | // redrawn, it will replace the adjacent line (when it lines up |
| 801 | // perfectly) or show a faint line (when off by a small amount). |
| 802 | // The alternative would be to wait, then draw the shape as a |
nothing calls this directly
no test coverage detected