Performance improvements in reloading the 3D scene.

Now the 3D scene loading is postponed until the page is visible.
This commit is contained in:
bubnikv 2017-05-31 17:05:11 +02:00
parent 556f40bf00
commit ee5ee5f432
4 changed files with 57 additions and 40 deletions

View file

@ -131,10 +131,16 @@ sub new {
}
sub reload_print {
my ($self) = @_;
my ($self, $force) = @_;
$self->canvas->reset_objects;
$self->_loaded(0);
if (! $self->IsShown && ! $force) {
$self->{reload_delayed} = 1;
return;
}
$self->load_print;
}
@ -289,4 +295,10 @@ sub set_number_extruders {
}
}
# Called by the Platter wxNotebook when this page is activated.
sub OnActivate {
my ($self) = @_;
$self->reload_scene(1) if ($self->{reload_delayed});
}
1;