Skip to content

Commit

Permalink
fix case where lineWidth equals 0
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed May 17, 2024
1 parent dd7297d commit 52173d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/webgl/webgl_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ export default class WebGLRenderer extends Renderer {
this.path2D.moveTo(startX, startY);
this.path2D.lineTo(endX, endY);
this.currentCompositor.drawVertices(this.gl.LINES, this.path2D.points);
} else {
} else if (this.lineWidth > 1) {
const halfWidth = this.lineWidth / 2;
const angle = Math.atan2(endY - startY, endX - startX);
const dx = Math.sin(angle) * halfWidth;
Expand Down

0 comments on commit 52173d9

Please sign in to comment.