FIX:arrow direction in scaling tool is incorrect
Jira: STUDIO-5672 Change-Id: I82c0ab336805e34c8380f93e64d3b9dbbf283805
This commit is contained in:
parent
dcbeb1baf7
commit
f6f27b700f
|
@ -444,28 +444,14 @@ void GizmoObjectManipulation::reset_scale_value()
|
||||||
change_scale_value(2, 100.);
|
change_scale_value(2, 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GizmoObjectManipulation::set_uniform_scaling(const bool new_value)
|
void GizmoObjectManipulation::set_uniform_scaling(const bool use_uniform_scale)
|
||||||
{
|
{
|
||||||
const Selection &selection = m_glcanvas.get_selection();
|
if (!use_uniform_scale)
|
||||||
if (selection.is_single_full_instance() && m_world_coordinates && !new_value) {
|
// Recalculate cached values at this panel, refresh the screen.
|
||||||
// Verify whether the instance rotation is multiples of 90 degrees, so that the scaling in world coordinates is possible.
|
this->UpdateAndShow(true);
|
||||||
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
|
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
|
||||||
// Is the angle close to a multiple of 90 degrees?
|
|
||||||
|
|
||||||
if (! Geometry::is_rotation_ninety_degrees(volume->get_instance_rotation())) {
|
m_uniform_scale = use_uniform_scale;
|
||||||
// Cannot apply scaling in the world coordinate system.
|
set_dirty();
|
||||||
// BBS: remove tilt prompt dialog
|
|
||||||
|
|
||||||
// Bake the rotation into the meshes of the object.
|
|
||||||
wxGetApp().model().objects[volume->composite_id.object_id]->bake_xy_rotation_into_meshes(volume->composite_id.instance_id);
|
|
||||||
// Update the 3D scene, selections etc.
|
|
||||||
wxGetApp().plater()->update();
|
|
||||||
// Recalculate cached values at this panel, refresh the screen.
|
|
||||||
this->UpdateAndShow(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_uniform_scale = new_value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* label_values[2][3] = {
|
static const char* label_values[2][3] = {
|
||||||
|
|
|
@ -1644,7 +1644,7 @@ void Selection::render_sidebar_hints(const std::string& sidebar_field, bool unif
|
||||||
glsafe(::glTranslated(center(0), center(1), center(2)));
|
glsafe(::glTranslated(center(0), center(1), center(2)));
|
||||||
if (!boost::starts_with(sidebar_field, "position")) {
|
if (!boost::starts_with(sidebar_field, "position")) {
|
||||||
Transform3d orient_matrix = Transform3d::Identity();
|
Transform3d orient_matrix = Transform3d::Identity();
|
||||||
if (boost::starts_with(sidebar_field, "scale"))
|
if (boost::starts_with(sidebar_field, "scale") || boost::starts_with(sidebar_field, "size"))
|
||||||
orient_matrix = (*m_volumes)[*m_list.begin()]->get_instance_transformation().get_matrix(true, false, true, true);
|
orient_matrix = (*m_volumes)[*m_list.begin()]->get_instance_transformation().get_matrix(true, false, true, true);
|
||||||
else if (boost::starts_with(sidebar_field, "rotation")) {
|
else if (boost::starts_with(sidebar_field, "rotation")) {
|
||||||
if (boost::ends_with(sidebar_field, "x"))
|
if (boost::ends_with(sidebar_field, "x"))
|
||||||
|
|
Loading…
Reference in New Issue