summaryrefslogtreecommitdiffhomepage
path: root/editor/tests
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-22 20:39:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-22 20:39:34 +0200
commitddf3051d41f7aa04e2c7fa80d5331831c801ae1f (patch)
tree0955071f8a2be40c6ec50d11caecf49417bdae7b /editor/tests
parent8428c93579e93dd9cecc3af6c79c731061c99a3a (diff)
fix sign issue on dijkstra max_dist
Diffstat (limited to 'editor/tests')
-rw-r--r--editor/tests/path.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/tests/path.cpp b/editor/tests/path.cpp
index 0a81dd62..2bc40717 100644
--- a/editor/tests/path.cpp
+++ b/editor/tests/path.cpp
@@ -6,6 +6,7 @@
#include "shaders/shader.hpp"
#include "../imgui-raii.hpp"
#include "src/camera-offset.hpp"
+#include <Magnum/Math/Functions.h>
namespace floormat::tests {
@@ -30,7 +31,7 @@ bool path_test::handle_mouse_click(app& a, const mouse_button_event& e, bool is_
{
constexpr auto chunk_size = iTILE_SIZE2 * TILE_MAX_DIM;
auto pt0 = C->position();
- auto vec = (pt->coord() - pt0.coord()) * iTILE_SIZE2 * 2 + chunk_size * 1;
+ auto vec = Math::abs((pt->coord() - pt0.coord())) * iTILE_SIZE2 * 2 + chunk_size * 1;
auto dist = (uint32_t)vec.length();
has_pending = true;