DoubleClick middle mouse button to zoom to extents (AutoCad style).

This commit is contained in:
uclaros 2016-11-02 14:38:25 +02:00
parent 8738d7f5e7
commit 45922e6f5d

View File

@ -148,6 +148,14 @@ sub mouse_event {
} elsif ($e->LeftDClick) { } elsif ($e->LeftDClick) {
$self->on_double_click->() $self->on_double_click->()
if $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) { } elsif (($e->LeftDown || $e->RightDown) && not $e->ShiftDown) {
# If user pressed left or right button we first check whether this happened # If user pressed left or right button we first check whether this happened
# on a volume or not. # on a volume or not.