mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-29 10:40:50 -07:00
Optimization: don't reload 3D toolpaths each time the preview tab is selected
This commit is contained in:
@@ -8,7 +8,7 @@ use Wx qw(:misc :sizer :slider :statictext wxWHITE);
|
||||
use Wx::Event qw(EVT_SLIDER EVT_KEY_DOWN);
|
||||
use base qw(Wx::Panel Class::Accessor);
|
||||
|
||||
__PACKAGE__->mk_accessors(qw(print enabled canvas slider));
|
||||
__PACKAGE__->mk_accessors(qw(print enabled _loaded canvas slider));
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
@@ -76,6 +76,14 @@ sub reload_print {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->canvas->reset_objects;
|
||||
$self->_loaded(0);
|
||||
$self->load_print;
|
||||
}
|
||||
|
||||
sub load_print {
|
||||
my ($self) = @_;
|
||||
|
||||
return if $self->_loaded;
|
||||
|
||||
# we require that there's at least one object and the posSlice step
|
||||
# is performed on all of them (this ensures that _shifted_copies was
|
||||
@@ -112,6 +120,7 @@ sub reload_print {
|
||||
$self->canvas->load_print_object_toolpaths($object);
|
||||
}
|
||||
$self->canvas->zoom_to_volumes;
|
||||
$self->_loaded(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user