Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomGamingDev committed Mar 3, 2024
1 parent 4b842df commit 612a943
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/webgl/p5.RendererGL.Immediate.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ p5.RendererGL.prototype.endShape = function(

// LINE_STRIP and LINES are not used for rendering, instead
// they only indicate a way to modify vertices during the _processVertices() step
let is_line = false;
if (
this.immediateMode.shapeMode === constants.LINE_STRIP ||
this.immediateMode.shapeMode === constants.LINES
) {
this.immediateMode.shapeMode = constants.TRIANGLE_FAN;
is_line = true;
}

// WebGL doesn't support the QUADS and QUAD_STRIP modes, so we
Expand All @@ -239,7 +241,7 @@ p5.RendererGL.prototype.endShape = function(
this.immediateMode.shapeMode = constants.TRIANGLE_STRIP;
}

if (this._doFill) {
if (this._doFill && !is_line) {
if (
!this.geometryBuilder &&
this.immediateMode.geometry.vertices.length >= 3
Expand Down

0 comments on commit 612a943

Please sign in to comment.