Completing the user actions in appearance view.

This commit is contained in:
brunoherbelin
2020-11-16 23:47:02 +01:00
parent 1ab2ae0df0
commit 3b529222d8
5 changed files with 124 additions and 47 deletions

View File

@@ -75,20 +75,6 @@ void ImGuiVisitor::visit(Group &n)
oss << "Position " << std::setprecision(3) << n.translation_.x << ", " << n.translation_.y;
Action::manager().store(oss.str(), n.id());
}
if (ImGuiToolkit::ButtonIcon(18, 9)){
n.rotation_.z = 0.f;
Action::manager().store("Angle 0.0", n.id());
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderAngle("Angle", &(n.rotation_.z), -180.f, 180.f) ;
if (ImGui::IsItemDeactivatedAfterEdit()) {
std::ostringstream oss;
oss << "Angle " << std::setprecision(3) << n.rotation_.z * 180.f / M_PI;
Action::manager().store(oss.str(), n.id());
}
if (ImGuiToolkit::ButtonIcon(3, 15)) {
n.scale_.x = 1.f;
n.scale_.y = 1.f;
@@ -108,6 +94,20 @@ void ImGuiVisitor::visit(Group &n)
Action::manager().store(oss.str(), n.id());
}
if (ImGuiToolkit::ButtonIcon(18, 9)){
n.rotation_.z = 0.f;
Action::manager().store("Angle 0.0", n.id());
}
ImGui::SameLine(0, 10);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
ImGui::SliderAngle("Angle", &(n.rotation_.z), -180.f, 180.f) ;
if (ImGui::IsItemDeactivatedAfterEdit()) {
std::ostringstream oss;
oss << "Angle " << std::setprecision(3) << n.rotation_.z * 180.f / M_PI;
Action::manager().store(oss.str(), n.id());
}
ImGui::PopID();
// spacing
@@ -417,7 +417,8 @@ void ImGuiVisitor::visit (Source& s)
s.processingShader()->accept(*this);
// geometry direct control
s.groupNode(View::GEOMETRY)->accept(*this);
// s.groupNode(View::GEOMETRY)->accept(*this);
// s.groupNode((View::Mode) Settings::application.current_view)->accept(*this);
ImGui::PopID();
}