Fixed synchronization of scale/size fields in sidebar for single volume and single full instance selection
This commit is contained in:
parent
4a5cff3ee2
commit
727884d327
@ -39,19 +39,13 @@ ObjectManipulation::ObjectManipulation(wxWindow* parent) :
|
|||||||
change_rotation_value(new_value);
|
change_rotation_value(new_value);
|
||||||
else if (param == "scale")
|
else if (param == "scale")
|
||||||
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
{
|
|
||||||
change_scale_value(new_value);
|
change_scale_value(new_value);
|
||||||
update_settings_value(wxGetApp().plater()->canvas3D()->get_selection());
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
change_scale_value(new_value);
|
change_scale_value(new_value);
|
||||||
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
else if (param == "size")
|
else if (param == "size")
|
||||||
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
{
|
|
||||||
change_size_value(new_value);
|
change_size_value(new_value);
|
||||||
update_settings_value(wxGetApp().plater()->canvas3D()->get_selection());
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
change_size_value(new_value);
|
change_size_value(new_value);
|
||||||
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
@ -548,18 +542,16 @@ void ObjectManipulation::change_size_value(const Vec3d& size)
|
|||||||
{
|
{
|
||||||
const GLCanvas3D::Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
|
const GLCanvas3D::Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
|
||||||
|
|
||||||
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
|
||||||
Vec3d ref_size = m_cache.size;
|
Vec3d ref_size = m_cache.size;
|
||||||
#else
|
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
Vec3d ref_size = m_cache_size;
|
if (selection.is_single_volume() || selection.is_single_modifier())
|
||||||
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
|
||||||
if (selection.is_single_full_instance())
|
|
||||||
{
|
{
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
||||||
ref_size = volume->bounding_box.size();
|
ref_size = volume->bounding_box.size();
|
||||||
}
|
}
|
||||||
|
else if (selection.is_single_full_instance())
|
||||||
|
ref_size = m_cache.instance.box_size;
|
||||||
|
|
||||||
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
|
||||||
Vec3d scale = 100.0 * Vec3d(size(0) / ref_size(0), size(1) / ref_size(1), size(2) / ref_size(2));
|
Vec3d scale = 100.0 * Vec3d(size(0) / ref_size(0), size(1) / ref_size(1), size(2) / ref_size(2));
|
||||||
Vec3d scaling_factor = scale;
|
Vec3d scaling_factor = scale;
|
||||||
|
|
||||||
@ -590,6 +582,12 @@ void ObjectManipulation::change_size_value(const Vec3d& size)
|
|||||||
|
|
||||||
m_cache.size = size;
|
m_cache.size = size;
|
||||||
#else
|
#else
|
||||||
|
if (selection.is_single_full_instance())
|
||||||
|
{
|
||||||
|
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
||||||
|
ref_size = volume->bounding_box.size();
|
||||||
|
}
|
||||||
|
|
||||||
change_scale_value(100.0 * Vec3d(size(0) / ref_size(0), size(1) / ref_size(1), size(2) / ref_size(2)));
|
change_scale_value(100.0 * Vec3d(size(0) / ref_size(0), size(1) / ref_size(1), size(2) / ref_size(2)));
|
||||||
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#endif // ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user