summaryrefslogtreecommitdiffhomepage
path: root/editor/draw.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-28 13:26:24 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-28 13:26:24 +0100
commit9e08dc86b8b9fa9830574ff6116d4af5541fc47e (patch)
tree7a41d076ab1cdcb0282cae07b4ce3bf9b0069adc /editor/draw.cpp
parent20e95a5cf095acbc9c76f335258a9bf5e220aaeb (diff)
cleanup some math code
Diffstat (limited to 'editor/draw.cpp')
-rw-r--r--editor/draw.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 844d26b3..bd30d80b 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -163,7 +163,7 @@ void app::draw_collision_boxes()
constexpr auto m = TILE_SIZE2 * Vector2(1- eps, 1- eps);
const auto tile_ = Vector2(M->pixel_to_tile_(Vector2d(pixel)));
const auto curchunk = Vector2(tile.chunk()), curtile = Vector2(tile.local());
- const auto subpixel_ = Vector2(std::fmod(tile_[0], 1.f), std::fmod(tile_[1], 1.f));
+ const auto subpixel_ = Math::fmod(tile_, 1.f);
// todo use this formula for dragging objs
const auto subpixel = m * Vector2(curchunk[0] < 0 ? 1 + subpixel_[0] : subpixel_[0],
curchunk[1] < 0 ? 1 + subpixel_[1] : subpixel_[1]);