From 7e0f8ca791de6d2786d8f44ca8a2e4c0c8d92215 Mon Sep 17 00:00:00 2001 From: Klonan <11986037+Klonan@users.noreply.github.com> Date: Fri, 16 Sep 2022 11:00:19 +0200 Subject: [PATCH] FIx polyline adding NaN normals, which breaks the line rendering --- src/modules/graphics/Polyline.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/graphics/Polyline.cpp b/src/modules/graphics/Polyline.cpp index 61a5b191c..f3dd603f2 100644 --- a/src/modules/graphics/Polyline.cpp +++ b/src/modules/graphics/Polyline.cpp @@ -24,6 +24,7 @@ // C++ #include +#include // treat adjacent segments with angles between their directions <5 degree as straight static const float LINES_PARALLEL_EPS = 0.05f; @@ -176,6 +177,12 @@ void MiterJoinPolyline::renderEdge(std::vector &anchors, std::vector &anchors, std::vector 0) { // lines parallel, compute as u1 = q + ns * w/2, u2 = q - ns * w/2 + assert(ns == ns); //NaN check normals.push_back(ns); normals.push_back(-ns); } @@ -193,6 +201,7 @@ void MiterJoinPolyline::renderEdge(std::vector &anchors, std::vector