summaryrefslogtreecommitdiffhomepage
path: root/editor/camera.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-12 04:18:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-12 05:29:31 +0100
commit1a2801f6751f1baf52d5d989b9cccab97b3c921b (patch)
tree0a9ed21f501bbea9b5088b69e7d39b1c322ec193 /editor/camera.cpp
parent802c17175e595ddb3075465a1febc432262bcc3f (diff)
use Optional's destructuring bind
Diffstat (limited to 'editor/camera.cpp')
-rw-r--r--editor/camera.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/camera.cpp b/editor/camera.cpp
index 35d24ef4..e22b20ba 100644
--- a/editor/camera.cpp
+++ b/editor/camera.cpp
@@ -59,8 +59,8 @@ void app::reset_camera_offset()
void app::update_cursor_tile(const Optional<Vector2i>& pixel)
{
cursor.pixel = pixel;
- if (pixel)
- cursor.tile = M->pixel_to_tile(Vector2d{*pixel});
+ if (const auto [p, b] = pixel; b)
+ cursor.tile = M->pixel_to_tile(Vector2d{p});
else
cursor.tile = NullOpt;
}