This commit is contained in:
Enrico Turri 2019-02-06 09:57:52 +01:00
parent 7c59c218c1
commit 21a7fa6af2
3 changed files with 24 additions and 23 deletions

View file

@ -73,14 +73,8 @@ ObjectManipulation::ObjectManipulation(wxWindow* parent) :
def.default_value = new ConfigOptionFloat(0.0);
def.width = 50;
if (option_name == "Rotation")
{
def.min = -360;
def.max = 360;
}
// Add "uniform scaling" button in front of "Scale" option
else if (option_name == "Scale") {
if (option_name == "Scale") {
line.near_label_widget = [this](wxWindow* parent) {
auto btn = new PrusaLockButton(parent, wxID_ANY);
btn->Bind(wxEVT_BUTTON, [btn, this](wxCommandEvent &event){
@ -293,13 +287,13 @@ void ObjectManipulation::update_if_dirty()
deg_rotation(i) = Geometry::rad2deg(m_new_rotation(i));
}
if (m_cache.rotation(0) != m_new_rotation(0))
if ((m_cache.rotation(0) != m_new_rotation(0)) || (m_new_rotation(0) == 0.0))
m_og->set_value("rotation_x", double_to_string(deg_rotation(0), 2));
if (m_cache.rotation(1) != m_new_rotation(1))
if ((m_cache.rotation(1) != m_new_rotation(1)) || (m_new_rotation(1) == 0.0))
m_og->set_value("rotation_y", double_to_string(deg_rotation(1), 2));
if (m_cache.rotation(2) != m_new_rotation(2))
if ((m_cache.rotation(2) != m_new_rotation(2)) || (m_new_rotation(2) == 0.0))
m_og->set_value("rotation_z", double_to_string(deg_rotation(2), 2));
m_cache.rotation = deg_rotation;