mirror of
https://github.com/processing/processing4.git
synced 2026-02-21 06:15:50 +01:00
Fix issue #1761
This commit is contained in:
@@ -195,7 +195,7 @@ public class LinePath {
|
||||
floatCoords = copyOf(floatCoords, size + grow);
|
||||
}
|
||||
size = pointColors.length;
|
||||
if (numCoords + newPoints > size) {
|
||||
if (numCoords/2 + newPoints > size) {
|
||||
int grow = size;
|
||||
if (grow > EXPAND_MAX) {
|
||||
grow = EXPAND_MAX;
|
||||
@@ -225,7 +225,7 @@ public class LinePath {
|
||||
if (numTypes > 0 && pointTypes[numTypes - 1] == SEG_MOVETO) {
|
||||
floatCoords[numCoords - 2] = x;
|
||||
floatCoords[numCoords - 1] = y;
|
||||
pointColors[numCoords/2] = c;
|
||||
pointColors[numCoords/2-1] = c;
|
||||
} else {
|
||||
needRoom(false, 1);
|
||||
pointTypes[numTypes++] = SEG_MOVETO;
|
||||
@@ -339,6 +339,8 @@ public class LinePath {
|
||||
PathIterator(LinePath p2df) {
|
||||
this.path = p2df;
|
||||
this.floatCoords = p2df.floatCoords;
|
||||
pointIdx = 0;
|
||||
colorIdx = 0;
|
||||
}
|
||||
|
||||
public int currentSegment(float[] coords) {
|
||||
@@ -381,8 +383,10 @@ public class LinePath {
|
||||
|
||||
public void next() {
|
||||
int type = path.pointTypes[typeIdx++];
|
||||
pointIdx += curvecoords[type];
|
||||
colorIdx++;
|
||||
if (0 < curvecoords[type]) {
|
||||
pointIdx += curvecoords[type];
|
||||
colorIdx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user