From e8a7d188eb186204dc8d8e25aa732e14fac96594 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 19 Oct 2023 12:44:38 +0200 Subject: a --- editor/camera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editor') diff --git a/editor/camera.cpp b/editor/camera.cpp index eb641c95..6dcaaa7d 100644 --- a/editor/camera.cpp +++ b/editor/camera.cpp @@ -143,8 +143,8 @@ void app::update_cursor_tile(const Optional& pixel) const auto tile_ = Vector2(M->pixel_to_tile_(Vector2d(*pixel))); const auto curchunk = Vector2(tile.chunk()); const auto subpixel_ = Vector2(std::fmod(tile_[0], 1.f), std::fmod(tile_[1], 1.f)); - auto subpixel = TILE_SIZE2 * Vector2(curchunk[0] < 0 ? 1 + subpixel_[0] : subpixel_[0], - curchunk[1] < 0 ? 1 + subpixel_[1] : subpixel_[1]); + auto subpixel = TILE_SIZE2 * Vector2(curchunk.x() < 0 ? 1 + subpixel_[0] : subpixel_[0], + curchunk.y() < 0 ? 1 + subpixel_[1] : subpixel_[1]); constexpr auto half_tile = Vector2(iTILE_SIZE2/2); subpixel -= half_tile; subpixel.x() = Math::clamp(std::round(subpixel.x()), -half_tile.x(), half_tile.x()-1); -- cgit v1.2.3