Fixed Object part editor because it wasn't updated with the new PreviewCanvas API. #2455

This commit is contained in:
Alessandro Ranellucci 2014-12-28 00:16:15 +01:00
parent 9803e2fabf
commit eba19aaba4

View File

@ -224,13 +224,7 @@ sub on_btn_load {
} }
} }
$self->reload_tree; $self->_parts_changed;
if ($self->{canvas}) {
$self->{canvas}->reset_objects;
$self->{canvas}->load_object($self->{model_object});
$self->{canvas}->set_bounding_box($self->{model_object}->bounding_box);
$self->{canvas}->Render;
}
} }
sub on_btn_delete { sub on_btn_delete {
@ -250,9 +244,17 @@ sub on_btn_delete {
$self->{parts_changed} = 1; $self->{parts_changed} = 1;
} }
$self->_parts_changed;
}
sub _parts_changed {
my ($self) = @_;
$self->reload_tree; $self->reload_tree;
if ($self->{canvas}) { if ($self->{canvas}) {
$self->{canvas}->reset_objects;
$self->{canvas}->load_object($self->{model_object}); $self->{canvas}->load_object($self->{model_object});
$self->{canvas}->zoom_to_volumes;
$self->{canvas}->Render; $self->{canvas}->Render;
} }
} }