summaryrefslogtreecommitdiffhomepage
path: root/editor/tests/raycast-test.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-03 18:45:25 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-03 18:45:25 +0100
commitd2966deaf90e47b0bfb954ef588a015653c20d26 (patch)
tree87326c4eb2be0d62400fc03b264d2cad1708bc9b /editor/tests/raycast-test.cpp
parent188d9101f30b3de7279c0e9056c2c1408e2ef09d (diff)
c
Diffstat (limited to 'editor/tests/raycast-test.cpp')
-rw-r--r--editor/tests/raycast-test.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/tests/raycast-test.cpp b/editor/tests/raycast-test.cpp
index c9ca6def..c813feac 100644
--- a/editor/tests/raycast-test.cpp
+++ b/editor/tests/raycast-test.cpp
@@ -229,7 +229,8 @@ struct raycast_test : base_test
void draw_ui(app&, float) override
{
constexpr ImGuiTableFlags table_flags = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_ScrollY;
- constexpr auto colflags_1 = ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_NoReorder | ImGuiTableColumnFlags_NoSort;
+ constexpr auto colflags_1 = ImGuiTableColumnFlags_NoResize | ImGuiTableColumnFlags_NoReorder |
+ ImGuiTableColumnFlags_NoSort;
constexpr auto colflags_0 = colflags_1 | ImGuiTableColumnFlags_WidthFixed;
constexpr auto print_coord = [](auto&& buf, Vector3i c, Vector2i l, Vector2i p)
@@ -394,7 +395,7 @@ struct raycast_test : base_test
Vector2d v;
v[long_axis] = std::copysign(step, V[long_axis]);
- v[short_axis] = std::copysign(Math::max(1., Math::min(tile_size<double>.x(), Math::abs(V[short_axis]))), V[short_axis]);
+ v[short_axis] = std::copysign(Math::clamp(Math::abs(V[short_axis]), 1., tile_size<double>.x()), V[short_axis]);
auto nsteps = (uint32_t)Math::max(1., Math::ceil(Math::abs(V[long_axis] / step)));