summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-19 03:09:18 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-19 03:09:18 +0100
commit02e32261880cfd90c300907c01e2e87e59dc7343 (patch)
treee306672eaf8bc99d6ee135b947d55e8f73d9bf46 /editor
parent67f029d1192f7baf881f6c1afd0bb2c301165ae9 (diff)
src/entity: short-circuit in can_rotate()
Diffstat (limited to 'editor')
-rw-r--r--editor/imgui.cpp2
-rw-r--r--editor/inspect-types.cpp2
2 files changed, 2 insertions, 2 deletions
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<scenery> {
#ifdef TEST_STR
entity::type<String>::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