Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2018-09-10 15:10:08 +0300
committerEnrico Turri <enricoturri@seznam.cz>2018-09-10 15:10:08 +0300
commit781df150a13a4ae3b55109fb728ef469cfbc8f7a (patch)
tree3746a75e1d2c761c317318e369d049c28dc262d9 /lib
parent1516c46d0b0f0428f7ff49a1860437f07e48beee (diff)
Added perl callback for gizmo flatten
Diffstat (limited to 'lib')
-rw-r--r--lib/Slic3r/GUI/Plater.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm
index 9b3457ef4..951f3bd0f 100644
--- a/lib/Slic3r/GUI/Plater.pm
+++ b/lib/Slic3r/GUI/Plater.pm
@@ -153,16 +153,15 @@ sub new {
};
# callback to react to gizmo rotate
- # omitting last three parameters means rotation around Z
- # otherwise they are the components of the rotation axis vector
my $on_gizmo_rotate = sub {
+ my ($angle) = @_;
+ $self->rotate(rad2deg($angle), Z, 'absolute');
+ };
+
+ # callback to react to gizmo flatten
+ my $on_gizmo_flatten = sub {
my ($angle, $axis_x, $axis_y, $axis_z) = @_;
- if (!defined $axis_x) {
- $self->rotate(rad2deg($angle), Z, 'absolute');
- }
- else {
- $self->rotate(rad2deg($angle), undef, 'absolute', $axis_x, $axis_y, $axis_z) if $angle != 0;
- }
+ $self->rotate(rad2deg($angle), undef, 'absolute', $axis_x, $axis_y, $axis_z) if $angle != 0;
};
# callback to update object's geometry info while using gizmos
@@ -263,6 +262,7 @@ sub new {
Slic3r::GUI::_3DScene::register_on_enable_action_buttons_callback($self->{canvas3D}, $enable_action_buttons);
Slic3r::GUI::_3DScene::register_on_gizmo_scale_uniformly_callback($self->{canvas3D}, $on_gizmo_scale_uniformly);
Slic3r::GUI::_3DScene::register_on_gizmo_rotate_callback($self->{canvas3D}, $on_gizmo_rotate);
+ Slic3r::GUI::_3DScene::register_on_gizmo_flatten_callback($self->{canvas3D}, $on_gizmo_flatten);
Slic3r::GUI::_3DScene::register_on_update_geometry_info_callback($self->{canvas3D}, $on_update_geometry_info);
Slic3r::GUI::_3DScene::register_action_add_callback($self->{canvas3D}, $on_action_add);
Slic3r::GUI::_3DScene::register_action_delete_callback($self->{canvas3D}, $on_action_delete);