Make PShapeOpenGL.setFill(int,int) always update tessellated vertices #902
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #900 (and #677 too).
PShapeOpenGL
provides "Tessellation update mode"beginTessellation()
andendTessellation()
.The current implementation of
PShapeOpenGL.setFill(int,int)
does the following:root.tessUpdate == true
), it updates the color associated with tessellated vertices;InGeometry
and set "tessellation required" flag withmarkForTessellation()
.The problem is that once the shape is tessellated, the tessellation doesn't seem to be performed again even after markForTessellation().
Another concern is that the behavior described above is inconsistent with
PShape.OpenGL.setFill(int)
overload, which does not care about "Tessellation update mode" and updates tessellated vertices anyway.This PR makes
PShapeOpenGL.setFill(int,int)
behaves like the other overloads.As a result, it also ignores "Tessellation update mode".
I am not 100% sure it is safe, since
beginTessellation()
andendTessellation()
look doing a lot of stuff.In particular, I think this change should be tested for the cases where tessellation creates new vertices.
Since I do not know the tessellation process in detail, such test cases are really appreciated.