mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Fixed the shape break logic in immediate and retained mode
This commit is contained in:
@@ -35,7 +35,6 @@ import processing.core.PVector;
|
||||
import java.net.URL;
|
||||
import java.nio.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EmptyStackException;
|
||||
import java.util.HashMap;
|
||||
@@ -1948,7 +1947,7 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
|
||||
inGeo.clear();
|
||||
|
||||
breakShape = false;
|
||||
breakShape = true;
|
||||
defaultEdges = true;
|
||||
|
||||
textureImage0 = textureImage;
|
||||
@@ -2035,6 +2034,7 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
return;
|
||||
}
|
||||
openContour = true;
|
||||
breakShape = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2043,8 +2043,7 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
showWarning("P3D: Need to call beginContour() first.");
|
||||
return;
|
||||
}
|
||||
openContour = false;
|
||||
breakShape = true;
|
||||
openContour = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3064,8 +3064,6 @@ public class PShapeOpenGL extends PShape {
|
||||
inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
|
||||
ambientColor, specularColor, emissiveColor, shininess);
|
||||
|
||||
boolean insideContour = false;
|
||||
|
||||
if (vertexCodeCount == 0) { // each point is a simple vertex
|
||||
if (vertices[0].length == 2) { // tesellating 2D vertices
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
@@ -3078,7 +3076,7 @@ public class PShapeOpenGL extends PShape {
|
||||
}
|
||||
} else { // coded set of vertices
|
||||
int index = 0;
|
||||
int code = VERTEX;
|
||||
int code = BREAK;
|
||||
|
||||
if (vertices[0].length == 2) { // tessellating a 2D path
|
||||
|
||||
@@ -3115,10 +3113,7 @@ public class PShapeOpenGL extends PShape {
|
||||
index++;
|
||||
|
||||
case BREAK:
|
||||
if (insideContour) {
|
||||
code = BREAK;
|
||||
}
|
||||
insideContour = true;
|
||||
code = BREAK;
|
||||
}
|
||||
}
|
||||
} else { // tessellating a 3D path
|
||||
@@ -3156,10 +3151,7 @@ public class PShapeOpenGL extends PShape {
|
||||
index++;
|
||||
|
||||
case BREAK:
|
||||
if (insideContour) {
|
||||
code = BREAK;
|
||||
}
|
||||
insideContour = true;
|
||||
code = BREAK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user