summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--editor/camera.cpp2
-rw-r--r--editor/draw.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/editor/camera.cpp b/editor/camera.cpp
index df5b2cb5..dfe985b4 100644
--- a/editor/camera.cpp
+++ b/editor/camera.cpp
@@ -104,7 +104,7 @@ object_id app::get_object_colliding_with_cursor()
[[maybe_unused]] auto x = std::bit_cast<collision_data>(data);
if (x.type == (uint64_t)collision_type::geometry)
return true;
- Vector2 min(rect.m_min[0], rect.m_min[1]), max(rect.m_max[0], rect.m_max[1]);
+ Vector2 min{rect.m_min}, max{rect.m_max};
if (t0 >= min && t0 <= max)
{
if (auto e_ = world.find_object(x.id);
diff --git a/editor/draw.cpp b/editor/draw.cpp
index c88984af..b366deaa 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -143,7 +143,7 @@ void app::draw_collision_boxes()
if (x.pass == (uint64_t)pass_mode::pass)
if (x.id < TILE_COUNT*2+1)
return true;
- Vector2 start(rect.m_min[0], rect.m_min[1]), end(rect.m_max[0], rect.m_max[1]);
+ Vector2 start{rect.m_min}, end{rect.m_max};
auto size = (end - start);
auto center = Vector3(start + size*.5f, 0.f);
shader.set_tint(x.pass == (uint64_t)pass_mode::pass ? pass_tint : tint);
@@ -190,7 +190,7 @@ void app::draw_collision_boxes()
if (x.pass == (uint64_t)pass_mode::pass)
if (x.id < TILE_COUNT*2+1)
return true;
- Vector2 start(rect.m_min[0], rect.m_min[1]), end(rect.m_max[0], rect.m_max[1]);
+ Vector2 start{rect.m_min}, end{rect.m_max};
auto size = end - start;
auto center = Vector3(start + size*.5f, 0.f);
_wireframe->rect.draw(shader, { center, size, 3 });