From 45922e6f5df5ee74e63c4945cd9c4224692258f8 Mon Sep 17 00:00:00 2001 From: uclaros Date: Wed, 2 Nov 2016 14:38:25 +0200 Subject: [PATCH] DoubleClick middle mouse button to zoom to extents (AutoCad style). --- lib/Slic3r/GUI/3DScene.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index ce158bd74..079008314 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -148,6 +148,14 @@ sub mouse_event { } elsif ($e->LeftDClick) { $self->on_double_click->() if $self->on_double_click; + } elsif ($e->MiddleDClick) { + if (@{$self->volumes}) { + $self->zoom_to_volumes; + } else { + $self->zoom_to_bed; + } + $self->_dirty(1); + $self->Refresh; } elsif (($e->LeftDown || $e->RightDown) && not $e->ShiftDown) { # If user pressed left or right button we first check whether this happened # on a volume or not.