diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-06-24 16:55:14 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-06-24 16:55:14 +0300 |
commit | 992170c5f66e1bc823c03a26ad43af8b03d188d3 (patch) | |
tree | 278323f8cf35e563ab8472e84ea27cfd81d88cc4 /src/slic3r/GUI/Camera.cpp | |
parent | 5320ed9374d4559ac0fcc5a299bd79018ed9a1cb (diff) |
1) Perspective camera set as default camera type
2) Camera type selection added to Preferences dialog
Diffstat (limited to 'src/slic3r/GUI/Camera.cpp')
-rw-r--r-- | src/slic3r/GUI/Camera.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/slic3r/GUI/Camera.cpp b/src/slic3r/GUI/Camera.cpp index 1f8513ac2..6cb8ff520 100644 --- a/src/slic3r/GUI/Camera.cpp +++ b/src/slic3r/GUI/Camera.cpp @@ -31,7 +31,7 @@ Camera::Camera() : phi(45.0f) , requires_zoom_to_bed(false) , inverted_phi(false) - , m_type(Ortho) + , m_type(Perspective) , m_target(Vec3d::Zero()) , m_theta(45.0f) , m_zoom(1.0) @@ -61,20 +61,17 @@ void Camera::set_type(EType type) if (m_type != type) { m_type = type; - - wxGetApp().app_config->set("camera_type", std::to_string(m_type)); + wxGetApp().app_config->set("use_perspective_camera", (m_type == Perspective) ? "1" : "0"); wxGetApp().app_config->save(); } } void Camera::set_type(const std::string& type) { - if (!type.empty() && (type != "1")) - { - unsigned char type_id = atoi(type.c_str()); - if (((unsigned char)Ortho < type_id) && (type_id < (unsigned char)Num_types)) - set_type((Camera::EType)type_id); - } + if (type == "1") + set_type(Perspective); + else + set_type(Ortho); } void Camera::select_next_type() |