From ae8b5551defc18842796521c5ea387921bca9006 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 a3762e5fe..07dd1bd0a 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