mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-21 20:18:17 +08:00
Don't trigger the on_move callback upon simple object selection with no dragging action
This commit is contained in:
parent
faed500520
commit
bb907fb405
@ -34,6 +34,7 @@ __PACKAGE__->mk_accessors( qw(_quat _dirty init
|
|||||||
_drag_volume_idx
|
_drag_volume_idx
|
||||||
_drag_start_pos
|
_drag_start_pos
|
||||||
_drag_start_xy
|
_drag_start_xy
|
||||||
|
_dragged
|
||||||
_camera_target
|
_camera_target
|
||||||
_zoom
|
_zoom
|
||||||
) );
|
) );
|
||||||
@ -160,6 +161,7 @@ sub mouse_event {
|
|||||||
# apply new temporary volume origin and ignore Z
|
# apply new temporary volume origin and ignore Z
|
||||||
$volume->origin->translate($vector->x, $vector->y, 0); #,,
|
$volume->origin->translate($vector->x, $vector->y, 0); #,,
|
||||||
$self->_drag_start_pos($cur_pos);
|
$self->_drag_start_pos($cur_pos);
|
||||||
|
$self->_dragged(1);
|
||||||
$self->Refresh;
|
$self->Refresh;
|
||||||
} elsif ($e->Dragging && !defined $self->_hover_volume_idx) {
|
} elsif ($e->Dragging && !defined $self->_hover_volume_idx) {
|
||||||
if ($e->LeftIsDown) {
|
if ($e->LeftIsDown) {
|
||||||
@ -200,11 +202,12 @@ sub mouse_event {
|
|||||||
}
|
}
|
||||||
} elsif ($e->LeftUp || $e->RightUp) {
|
} elsif ($e->LeftUp || $e->RightUp) {
|
||||||
if ($self->on_move && defined $self->_drag_volume_idx) {
|
if ($self->on_move && defined $self->_drag_volume_idx) {
|
||||||
$self->on_move->($self->_drag_volume_idx);
|
$self->on_move->($self->_drag_volume_idx) if $self->_dragged;
|
||||||
}
|
}
|
||||||
$self->_drag_volume_idx(undef);
|
$self->_drag_volume_idx(undef);
|
||||||
$self->_drag_start_pos(undef);
|
$self->_drag_start_pos(undef);
|
||||||
$self->_drag_start_xy(undef);
|
$self->_drag_start_xy(undef);
|
||||||
|
$self->_dragged(undef);
|
||||||
} elsif ($e->Moving) {
|
} elsif ($e->Moving) {
|
||||||
$self->_mouse_pos($pos);
|
$self->_mouse_pos($pos);
|
||||||
$self->Refresh;
|
$self->Refresh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user