From 90a3b8fc93d44204fd479f3620228eff196af479 Mon Sep 17 00:00:00 2001 From: Quentin Quadrat Date: Sun, 17 Dec 2023 19:23:22 +0100 Subject: [PATCH] Fix arrow orientation --- src/Editor/DearImGui/Drawable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Editor/DearImGui/Drawable.cpp b/src/Editor/DearImGui/Drawable.cpp index b52d8cf..03f45d2 100644 --- a/src/Editor/DearImGui/Drawable.cpp +++ b/src/Editor/DearImGui/Drawable.cpp @@ -40,8 +40,8 @@ static void drawArrow(ImDrawList* draw_list, ImVec2 const& A, ImVec2 const& B, constexpr float pi = 3.14159265358979323846f; // Orientation - const float arrowAngle = std::atan((B.y - A.y) / (B.x - A.x)); - // + (B.x < A.x) ? pi : ((B.y < A.y) ? (2.0f * pi) : 0.0f); + const float arrowAngle = std::atan((B.y - A.y) / (B.x - A.x)) + + ((B.x < A.x) ? pi : ((B.y < A.y) ? (2.0f * pi) : 0.0f)); const float cos_a = std::cos(arrowAngle); const float sin_a = std::sin(arrowAngle);