mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Uniform scale is sidebar
This commit is contained in:
parent
24e0c9b79e
commit
7cf67db332
2 changed files with 10 additions and 5 deletions
|
@ -2513,7 +2513,9 @@ void GLCanvas3D::Selection::_render_sidebar_rotation_hints(const std::string& si
|
||||||
|
|
||||||
void GLCanvas3D::Selection::_render_sidebar_scale_hints(const std::string& sidebar_field) const
|
void GLCanvas3D::Selection::_render_sidebar_scale_hints(const std::string& sidebar_field) const
|
||||||
{
|
{
|
||||||
if (boost::ends_with(sidebar_field, "x") || requires_uniform_scale())
|
bool uniform_scale = requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling();
|
||||||
|
|
||||||
|
if (boost::ends_with(sidebar_field, "x") || uniform_scale)
|
||||||
{
|
{
|
||||||
::glPushMatrix();
|
::glPushMatrix();
|
||||||
::glRotated(-90.0, 0.0, 0.0, 1.0);
|
::glRotated(-90.0, 0.0, 0.0, 1.0);
|
||||||
|
@ -2521,14 +2523,14 @@ void GLCanvas3D::Selection::_render_sidebar_scale_hints(const std::string& sideb
|
||||||
::glPopMatrix();
|
::glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boost::ends_with(sidebar_field, "y") || requires_uniform_scale())
|
if (boost::ends_with(sidebar_field, "y") || uniform_scale)
|
||||||
{
|
{
|
||||||
::glPushMatrix();
|
::glPushMatrix();
|
||||||
_render_sidebar_scale_hint(Y);
|
_render_sidebar_scale_hint(Y);
|
||||||
::glPopMatrix();
|
::glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boost::ends_with(sidebar_field, "z") || requires_uniform_scale())
|
if (boost::ends_with(sidebar_field, "z") || uniform_scale)
|
||||||
{
|
{
|
||||||
::glPushMatrix();
|
::glPushMatrix();
|
||||||
::glRotated(90.0, 1.0, 0.0, 0.0);
|
::glRotated(90.0, 1.0, 0.0, 0.0);
|
||||||
|
@ -2559,7 +2561,7 @@ void GLCanvas3D::Selection::_render_sidebar_rotation_hint(Axis axis) const
|
||||||
|
|
||||||
void GLCanvas3D::Selection::_render_sidebar_scale_hint(Axis axis) const
|
void GLCanvas3D::Selection::_render_sidebar_scale_hint(Axis axis) const
|
||||||
{
|
{
|
||||||
m_arrow.set_color((requires_uniform_scale() ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis]), 3);
|
m_arrow.set_color(((requires_uniform_scale() || wxGetApp().obj_manipul()->get_uniform_scaling()) ? UNIFORM_SCALE_COLOR : AXES_COLOR[axis]), 3);
|
||||||
|
|
||||||
::glTranslated(0.0, 5.0, 0.0);
|
::glTranslated(0.0, 5.0, 0.0);
|
||||||
m_arrow.render();
|
m_arrow.render();
|
||||||
|
|
|
@ -399,6 +399,9 @@ void ObjectManipulation::update_if_dirty()
|
||||||
|
|
||||||
m_cache.rotation = m_new_rotation;
|
m_cache.rotation = m_new_rotation;
|
||||||
|
|
||||||
|
// if (wxGetApp().plater()->canvas3D()->get_selection().requires_uniform_scale())
|
||||||
|
// m_uniform_scale = true;
|
||||||
|
|
||||||
if (m_new_enabled)
|
if (m_new_enabled)
|
||||||
m_og->enable();
|
m_og->enable();
|
||||||
else
|
else
|
||||||
|
@ -499,7 +502,7 @@ void ObjectManipulation::change_scale_value(const Vec3d& scale)
|
||||||
{
|
{
|
||||||
Vec3d scaling_factor = scale;
|
Vec3d scaling_factor = scale;
|
||||||
const GLCanvas3D::Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
|
const GLCanvas3D::Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
|
||||||
if (selection.requires_uniform_scale())
|
if (m_uniform_scale || selection.requires_uniform_scale())
|
||||||
{
|
{
|
||||||
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
#if ENABLE_IMPROVED_SIDEBAR_OBJECTS_MANIPULATION
|
||||||
Vec3d abs_scale_diff = (scale - m_cache.scale).cwiseAbs();
|
Vec3d abs_scale_diff = (scale - m_cache.scale).cwiseAbs();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue