From 612a943cf35a1f8c78e4ac2e21bfdcaf638f0de4 Mon Sep 17 00:00:00 2001 From: RandomGamingDev Date: Sat, 2 Mar 2024 19:54:26 -0500 Subject: [PATCH] fix --- src/webgl/p5.RendererGL.Immediate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/webgl/p5.RendererGL.Immediate.js b/src/webgl/p5.RendererGL.Immediate.js index fbe5472561..42e71fc115 100644 --- a/src/webgl/p5.RendererGL.Immediate.js +++ b/src/webgl/p5.RendererGL.Immediate.js @@ -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 @@ -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