diff --git a/android/core/src/processing/opengl/PGraphicsOpenGL.java b/android/core/src/processing/opengl/PGraphicsOpenGL.java index fbe53a183..6755c3361 100644 --- a/android/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/android/core/src/processing/opengl/PGraphicsOpenGL.java @@ -10270,9 +10270,9 @@ public class PGraphicsOpenGL extends PGraphics { ArrayList inDupList = new ArrayList(inDupSet); Collections.sort(inDupList); for (int i = inInd0; i <= inInd1; i++) { - int ri = tess.polyIndices[i]; + int ri = tess.polyIndices[offset + i]; if (ri < 0) { - tess.polyIndices[i] = (short) (inMaxRel + 1 + inDupList.indexOf(ri)); + tess.polyIndices[offset + i] = (short) (inMaxRel + 1 + inDupList.indexOf(ri)); } } diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index fbe53a183..6755c3361 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -10270,9 +10270,9 @@ public class PGraphicsOpenGL extends PGraphics { ArrayList inDupList = new ArrayList(inDupSet); Collections.sort(inDupList); for (int i = inInd0; i <= inInd1; i++) { - int ri = tess.polyIndices[i]; + int ri = tess.polyIndices[offset + i]; if (ri < 0) { - tess.polyIndices[i] = (short) (inMaxRel + 1 + inDupList.indexOf(ri)); + tess.polyIndices[offset + i] = (short) (inMaxRel + 1 + inDupList.indexOf(ri)); } }