mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 06:45:58 +08:00
Tech ENABLE_TRANSFORMATIONS_BY_MATRICES - Fixed scale reset
This commit is contained in:
parent
2badd508ae
commit
01257f9fe8
@ -460,13 +460,24 @@ ObjectManipulation::ObjectManipulation(wxWindow* parent) :
|
|||||||
m_reset_scale_button = new ScalableButton(parent, wxID_ANY, ScalableBitmap(parent, "undo"));
|
m_reset_scale_button = new ScalableButton(parent, wxID_ANY, ScalableBitmap(parent, "undo"));
|
||||||
m_reset_scale_button->SetToolTip(_L("Reset scale"));
|
m_reset_scale_button->SetToolTip(_L("Reset scale"));
|
||||||
m_reset_scale_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
|
m_reset_scale_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
|
||||||
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _L("Reset scale"));
|
|
||||||
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
#if ENABLE_TRANSFORMATIONS_BY_MATRICES
|
||||||
bool old_uniform = m_uniform_scale;
|
GLCanvas3D* canvas = wxGetApp().plater()->canvas3D();
|
||||||
m_uniform_scale = true;
|
Selection& selection = canvas->get_selection();
|
||||||
change_scale_value(0, 100.0);
|
if (selection.is_single_volume_or_modifier())
|
||||||
m_uniform_scale = old_uniform;
|
const_cast<GLVolume*>(selection.get_first_volume())->set_volume_scaling_factor(Vec3d::Ones());
|
||||||
|
else if (selection.is_single_full_instance()) {
|
||||||
|
for (unsigned int idx : selection.get_volume_idxs()) {
|
||||||
|
const_cast<GLVolume*>(selection.get_volume(idx))->set_instance_scaling_factor(Vec3d::Ones());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
canvas->do_scale(L("Reset scale"));
|
||||||
|
|
||||||
|
UpdateAndShow(true);
|
||||||
#else
|
#else
|
||||||
|
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _L("Reset scale"));
|
||||||
change_scale_value(0, 100.);
|
change_scale_value(0, 100.);
|
||||||
change_scale_value(1, 100.);
|
change_scale_value(1, 100.);
|
||||||
change_scale_value(2, 100.);
|
change_scale_value(2, 100.);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user