From 02e32261880cfd90c300907c01e2e87e59dc7343 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Mar 2023 03:09:18 +0100 Subject: src/entity: short-circuit in can_rotate() --- editor/imgui.cpp | 2 +- editor/inspect-types.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'editor') diff --git a/editor/imgui.cpp b/editor/imgui.cpp index d4bb7f65..fd8a5c72 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -155,7 +155,7 @@ void app::do_popup_menu() inspectors.push_back(std::exchange(_popup_target, {})); ImGui::SeparatorText("Modify"); if (auto next_rot = sc->atlas->next_rotation_from(sc->r); - next_rot != sc->r && ImGui::MenuItem("Rotate", nullptr, false, next_rot != sc->r)) + ImGui::MenuItem("Rotate", nullptr, false, next_rot != sc->r && sc->can_rotate(next_rot))) sc->rotate(i, next_rot); if (ImGui::MenuItem("Delete", nullptr, false)) sc->chunk().remove_entity(sc->index()); diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp index f43bdc7a..2bca8a3c 100644 --- a/editor/inspect-types.cpp +++ b/editor/inspect-types.cpp @@ -63,7 +63,7 @@ struct entity_accessors { #ifdef TEST_STR entity::type::field{"string"_s, [](const scenery&) { return my_str; }, - [](scenery&, String value) { my_str = std::move(value); }, + [](scenery&, String value) { my_str = std::move_to(value); }, constantly(constraints::max_length{8}), }, #endif -- cgit v1.2.3