Skip to content

Commit

Permalink
Fix arrow orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Dec 17, 2023
1 parent 056c105 commit 2258a0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Editor/DearImGui/Drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2258a0b

Please sign in to comment.