mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 01:15:52 +08:00
* Make mouse-wheel in 2D toolpath zoom in the same direction as it does in 3D and 3D-preview * Add a GUI preference setting for whether to invert the direction that mouse-wheel scrolling will zoom in the 2D and 3D panels.
This commit is contained in:
parent
0741ecc2aa
commit
25bcff3656
@ -67,6 +67,7 @@ our $Settings = {
|
||||
mode => 'simple',
|
||||
version_check => 1,
|
||||
autocenter => 1,
|
||||
invert_zoom => 0,
|
||||
background_processing => 0,
|
||||
# If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden.
|
||||
# By default, Prusa has the controller hidden.
|
||||
@ -124,6 +125,7 @@ sub OnInit {
|
||||
$last_version = $Settings->{_}{version};
|
||||
$Settings->{_}{mode} ||= 'expert';
|
||||
$Settings->{_}{autocenter} //= 1;
|
||||
$Settings->{_}{invert_zoom} //= 0;
|
||||
$Settings->{_}{background_processing} //= 1;
|
||||
# If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden.
|
||||
$Settings->{_}{no_controller} //= 1;
|
||||
|
@ -127,6 +127,9 @@ sub new {
|
||||
|
||||
# Calculate the zoom delta and apply it to the current zoom factor
|
||||
my $zoom = $e->GetWheelRotation() / $e->GetWheelDelta();
|
||||
if ($Slic3r::GUI::Settings->{_}{invert_zoom}) {
|
||||
$zoom *= -1;
|
||||
}
|
||||
$zoom = max(min($zoom, 4), -4);
|
||||
$zoom /= 10;
|
||||
$self->_zoom($self->_zoom / (1-$zoom));
|
||||
|
@ -179,7 +179,10 @@ sub new {
|
||||
my $old_zoom = $self->_zoom;
|
||||
|
||||
# Calculate the zoom delta and apply it to the current zoom factor
|
||||
my $zoom = $e->GetWheelRotation() / $e->GetWheelDelta();
|
||||
my $zoom = -$e->GetWheelRotation() / $e->GetWheelDelta();
|
||||
if ($Slic3r::GUI::Settings->{_}{invert_zoom}) {
|
||||
$zoom *= -1;
|
||||
}
|
||||
$zoom = max(min($zoom, 4), -4);
|
||||
$zoom /= 10;
|
||||
$self->_zoom($self->_zoom / (1-$zoom));
|
||||
|
@ -52,6 +52,13 @@ sub new {
|
||||
tooltip => 'If this is enabled, Slic3r will auto-center objects around the print bed center.',
|
||||
default => $Slic3r::GUI::Settings->{_}{autocenter},
|
||||
));
|
||||
$optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new(
|
||||
opt_id => 'invert_zoom',
|
||||
type => 'bool',
|
||||
label => 'Invert zoom in previews',
|
||||
tooltip => 'If this is enabled, Slic3r will invert the direction of mouse-wheel zoom in preview panes.',
|
||||
default => $Slic3r::GUI::Settings->{_}{invert_zoom},
|
||||
));
|
||||
$optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new(
|
||||
opt_id => 'background_processing',
|
||||
type => 'bool',
|
||||
|
Loading…
x
Reference in New Issue
Block a user