ENH: save uniform scale to an app_config item

Change-Id: Ib4a42597308382ea195d73776790e9cd4a122b76
This commit is contained in:
Stone Li 2022-09-26 15:54:26 +08:00 committed by Lane.Wei
parent c6d6784070
commit 2996affc55
3 changed files with 11 additions and 0 deletions

View File

@ -299,6 +299,10 @@ void AppConfig::set_defaults()
}
#endif
if (get("uniform_scale").empty()) {
set("uniform_scale", "1");
}
// Remove legacy window positions/sizes
erase("app", "main_frame_maximized");
erase("app", "main_frame_pos");

View File

@ -463,6 +463,9 @@ void GizmoObjectManipulation::set_uniform_scaling(const bool new_value)
}
}
m_uniform_scale = new_value;
AppConfig* config = wxGetApp().app_config;
if (config)
config->set("uniform_scale", new_value ? "1": "0");
}
static const char* label_values[2][3] = {
@ -894,6 +897,9 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
ImGui::Separator();
AppConfig* config = wxGetApp().app_config;
if (config)
this->m_uniform_scale = config->get("uniform_scale") == "1" ? true : false;
bool uniform_scale = this->m_uniform_scale;
const Selection &selection = m_glcanvas.get_selection();

View File

@ -81,6 +81,7 @@ public:
Vec3d m_buffered_size;
bool m_new_enabled {true};
bool m_uniform_scale {true};
bool m_uniform_config {false};
// Does the object manipulation panel work in World or Local coordinates?
bool m_world_coordinates = true;