mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-08 14:34:04 -06:00
3DScene layer_editing_allowed method moved to c++
This commit is contained in:
parent
c51ce63b9b
commit
a8311bd1bd
9 changed files with 51 additions and 18 deletions
|
@ -350,16 +350,16 @@ sub Destroy {
|
|||
# }
|
||||
# return $self->{layer_editing_enabled};
|
||||
#}
|
||||
#
|
||||
#sub layer_editing_allowed {
|
||||
# my ($self) = @_;
|
||||
# # Allow layer editing if either the shaders were not initialized yet and we don't know
|
||||
# # whether it will be possible to initialize them,
|
||||
# # or if the initialization was done already and it failed.
|
||||
# return ! (defined($self->{layer_editing_initialized}) && $self->{layer_editing_initialized} == 2);
|
||||
#}
|
||||
#==============================================================================================================================
|
||||
|
||||
sub layer_editing_allowed {
|
||||
my ($self) = @_;
|
||||
# Allow layer editing if either the shaders were not initialized yet and we don't know
|
||||
# whether it will be possible to initialize them,
|
||||
# or if the initialization was done already and it failed.
|
||||
return ! (defined($self->{layer_editing_initialized}) && $self->{layer_editing_initialized} == 2);
|
||||
}
|
||||
|
||||
sub _first_selected_object_id_for_variable_layer_height_editing {
|
||||
my ($self) = @_;
|
||||
for my $i (0..$#{$self->volumes}) {
|
||||
|
|
|
@ -1836,7 +1836,10 @@ sub on_config_change {
|
|||
#==============================================================================================================================
|
||||
$self->{canvas3D}->Refresh;
|
||||
$self->{canvas3D}->Update;
|
||||
} elsif ($self->{canvas3D}->layer_editing_allowed) {
|
||||
#==============================================================================================================================
|
||||
} elsif (Slic3r::GUI::_3DScene::is_layers_editing_allowed($self->{canvas3D})) {
|
||||
# } elsif ($self->{canvas3D}->layer_editing_allowed) {
|
||||
#==============================================================================================================================
|
||||
# Want to allow the layer editing, but do it only if the OpenGL supports it.
|
||||
if ($self->{htoolbar}) {
|
||||
$self->{htoolbar}->EnableTool(TB_LAYER_EDITING, 1);
|
||||
|
@ -1997,7 +2000,10 @@ sub object_list_changed {
|
|||
|
||||
# Enable/disable buttons depending on whether there are any objects on the platter.
|
||||
my $have_objects = @{$self->{objects}} ? 1 : 0;
|
||||
my $variable_layer_height_allowed = $self->{config}->variable_layer_height && $self->{canvas3D}->layer_editing_allowed;
|
||||
#==============================================================================================================================
|
||||
my $variable_layer_height_allowed = $self->{config}->variable_layer_height && Slic3r::GUI::_3DScene::is_layers_editing_allowed($self->{canvas3D});
|
||||
# my $variable_layer_height_allowed = $self->{config}->variable_layer_height && $self->{canvas3D}->layer_editing_allowed;
|
||||
#==============================================================================================================================
|
||||
if ($self->{htoolbar}) {
|
||||
# On OSX or Linux
|
||||
$self->{htoolbar}->EnableTool($_, $have_objects)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue