From 0045375f6c789087a9633471938ceae470198060 Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Fri, 20 Dec 2019 08:21:23 +0100 Subject: [PATCH] Fixed bug / changed pi like the pi could get removed if mucke wants to --- src/IntelliHelper/IntelliHelper.cpp | 6 ++++-- src/IntelliPhoto.pro | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/IntelliHelper/IntelliHelper.cpp b/src/IntelliHelper/IntelliHelper.cpp index 944d0c6..d9aa439 100644 --- a/src/IntelliHelper/IntelliHelper.cpp +++ b/src/IntelliHelper/IntelliHelper.cpp @@ -3,6 +3,8 @@ #include #include +#define pi 3.14159265359 + std::vector IntelliHelper::calculateTriangles(std::vector polyPoints){ // helper for managing the triangle vertices and their state @@ -46,7 +48,7 @@ std::vector IntelliHelper::calculateTriangles(std::vector poly // return if the vertex is a tip auto isTip = [](float angle){ - return static_cast(angle)<(M_PI/2.); + return static_cast(angle)<(pi/2.); }; std::vector Vertices; @@ -88,7 +90,7 @@ std::vector IntelliHelper::calculateTriangles(std::vector poly } // update post und prev index - post = post-1; + post = getPrev(post, Vertices.size()); prev = prev