diff options
author | enricoturri1966 <enricoturri@seznam.cz> | 2022-05-05 11:12:16 +0300 |
---|---|---|
committer | enricoturri1966 <enricoturri@seznam.cz> | 2022-06-06 10:07:50 +0300 |
commit | b5d366d385a8f0f9e44f08470ee1910051fcf0fa (patch) | |
tree | d596f69e0187fe428a15b67076ebbe74825567b7 /src/slic3r/GUI/Gizmos/GLGizmoScale.cpp | |
parent | 63c9ce23df0ffd6d8d4d1c6fa1dc0a185f554c6e (diff) |
Tech ENABLE_TRANSFORMATIONS_BY_MATRICES - Allow skew in matrices
Fixed conflicts during rebase with master
Diffstat (limited to 'src/slic3r/GUI/Gizmos/GLGizmoScale.cpp')
-rw-r--r-- | src/slic3r/GUI/Gizmos/GLGizmoScale.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp b/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp index 675ed0b3f..061361e40 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoScale.cpp @@ -75,14 +75,36 @@ bool GLGizmoScale3D::on_mouse(const wxMouseEvent &mouse_event) { if (mouse_event.Dragging()) { if (m_dragging) { +#if !ENABLE_TRANSFORMATIONS_BY_MATRICES +#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED + int res = 1; + if (m_scale.x() != m_scale.y() || m_scale.x() != m_scale.z()) + res = m_parent.get_selection().bake_transform_if_needed(); + + if (res != 1) { + do_stop_dragging(true); + return true; + } + else { +#endif // ENABLE_WORLD_COORDINATE_SCALE_REVISITED +#endif // !ENABLE_TRANSFORMATIONS_BY_MATRICES // Apply new temporary scale factors TransformationType transformation_type(TransformationType::Local_Absolute_Joint); if (mouse_event.AltDown()) transformation_type.set_independent(); - Selection &selection = m_parent.get_selection(); - selection.scale(get_scale(), transformation_type); - if (mouse_event.CmdDown()) selection.translate(m_offset, ECoordinatesType::Local); - } + Selection &selection = m_parent.get_selection(); + selection.scale(m_scale, transformation_type); +#if ENABLE_WORLD_COORDINATE + if (mouse_event.CmdDown()) selection.translate(m_offset, wxGetApp().obj_manipul()->get_coordinates_type()); +#else + if (mouse_event.CmdDown()) selection.translate(m_offset, true); +#endif // ENABLE_WORLD_COORDINATE +#if !ENABLE_TRANSFORMATIONS_BY_MATRICES +#if ENABLE_WORLD_COORDINATE_SCALE_REVISITED + } +#endif // ENABLE_WORLD_COORDINATE_SCALE_REVISITED +#endif // !ENABLE_TRANSFORMATIONS_BY_MATRICES + } } return use_grabbers(mouse_event); } |