mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	3DScene _first_selected_object_id_for_variable_layer_height_editing method moved to c++
This commit is contained in:
		
							parent
							
								
									951e8528b4
								
							
						
					
					
						commit
						994222c317
					
				
					 8 changed files with 71 additions and 25 deletions
				
			
		|  | @ -360,21 +360,21 @@ sub Destroy { | |||
| #    # 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}) { | ||||
| #        if ($self->volumes->[$i]->selected) { | ||||
| #            my $object_id = int($self->volumes->[$i]->select_group_id / 1000000); | ||||
| #            # Objects with object_id >= 1000 have a specific meaning, for example the wipe tower proxy. | ||||
| #            return ($object_id >= $self->{print}->object_count) ? -1 : $object_id | ||||
| #                if $object_id < 10000; | ||||
| #        } | ||||
| #    } | ||||
| #    return -1; | ||||
| #} | ||||
| #============================================================================================================================== | ||||
| 
 | ||||
| sub _first_selected_object_id_for_variable_layer_height_editing { | ||||
|     my ($self) = @_; | ||||
|     for my $i (0..$#{$self->volumes}) { | ||||
|         if ($self->volumes->[$i]->selected) { | ||||
|             my $object_id = int($self->volumes->[$i]->select_group_id / 1000000); | ||||
|             # Objects with object_id >= 1000 have a specific meaning, for example the wipe tower proxy. | ||||
|             return ($object_id >= $self->{print}->object_count) ? -1 : $object_id | ||||
|                 if $object_id < 10000; | ||||
|         } | ||||
|     } | ||||
|     return -1; | ||||
| } | ||||
| 
 | ||||
| # Returns an array with (left, top, right, bottom) of the variable layer thickness bar on the screen. | ||||
| sub _variable_layer_thickness_bar_rect_screen { | ||||
|     my ($self) = @_; | ||||
|  | @ -498,7 +498,7 @@ sub mouse_event { | |||
|      | ||||
|     my $pos = Slic3r::Pointf->new($e->GetPositionXY); | ||||
| #============================================================================================================================== | ||||
|     my $object_idx_selected = (Slic3r::GUI::_3DScene::is_layers_editing_enabled($self) && $self->{print}) ? $self->_first_selected_object_id_for_variable_layer_height_editing : -1; | ||||
|     my $object_idx_selected = (Slic3r::GUI::_3DScene::is_layers_editing_enabled($self) && $self->{print}) ? Slic3r::GUI::_3DScene::get_layers_editing_first_selected_object_id($self, $self->{print}->object_count) : -1; | ||||
|     Slic3r::GUI::_3DScene::set_layers_editing_last_object_id($self, $object_idx_selected); | ||||
| #    my $object_idx_selected = $self->{layer_height_edit_last_object_id} = ($self->layer_editing_enabled && $self->{print}) ? $self->_first_selected_object_id_for_variable_layer_height_editing : -1; | ||||
| #============================================================================================================================== | ||||
|  | @ -732,9 +732,10 @@ sub mouse_wheel_event { | |||
|     } | ||||
| #============================================================================================================================== | ||||
|     if (Slic3r::GUI::_3DScene::is_layers_editing_enabled($self) && $self->{print}) { | ||||
|         my $object_idx_selected = Slic3r::GUI::_3DScene::get_layers_editing_first_selected_object_id($self, $self->{print}->object_count); | ||||
| #    if ($self->layer_editing_enabled && $self->{print}) { | ||||
| #        my $object_idx_selected = $self->_first_selected_object_id_for_variable_layer_height_editing; | ||||
| #============================================================================================================================== | ||||
|         my $object_idx_selected = $self->_first_selected_object_id_for_variable_layer_height_editing; | ||||
|         if ($object_idx_selected != -1) { | ||||
|             # A volume is selected. Test, whether hovering over a layer thickness bar. | ||||
|             if ($self->_variable_layer_thickness_bar_rect_mouse_inside($e)) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri