FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix line join triangles · processing/processing@f479824 · GitHub

Repository navigation

Commit f479824

Browse files
committed
Fix line join triangles
Fixes #5353
1 parent 0e9174a commit f479824

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎core/src/processing/opengl/shaders/LineVert.glsl‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ void main() {
7171
// and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)
7272
// t = +- normalize( (q.xy*p.w - p.xy*q.w) * viewport.zw )
7373

74-
vec2 tangent = normalize((q.xy*p.w - p.xy*q.w) * viewport.zw);
74+
vec2 tangent = (q.xy*p.w - p.xy*q.w) * viewport.zw;
75+
76+
// don't normalize zero vector (line join triangles and lines perpendicular to the eye plane)
77+
tangent = length(tangent) == 0.0 ? vec2(0.0, 0.0) : normalize(tangent);
7578

7679
// flip tangent to normal (it's already normalized)
7780
vec2 normal = vec2(-tangent.y, tangent.x);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL