mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Delayed loading of the opengl texture for the G-code preview legend,
as the opengl context may not be ready on some platforms (Linux) at the time the window gets its focus for the first time. Changed the G-code preview invalidation to trigger when the print gets invalidated. At that time the 3D path preview switches to the old preview, if there is anything valid left.
This commit is contained in:
		
							parent
							
								
									b5bdb46268
								
							
						
					
					
						commit
						f9cdda7bfd
					
				
					 6 changed files with 68 additions and 79 deletions
				
			
		|  | @ -1602,7 +1602,8 @@ sub draw_legend { | |||
|   | ||||
|     if ($self->_legend_enabled) | ||||
|     { | ||||
|         my $tex_id = Slic3r::GUI::_3DScene::get_legend_texture_id; | ||||
|         # If the legend texture has not been loaded into the GPU, do it now. | ||||
|         my $tex_id = Slic3r::GUI::_3DScene::finalize_legend_texture; | ||||
|         if ($tex_id > 0) | ||||
|         { | ||||
|             my $tex_w = Slic3r::GUI::_3DScene::get_legend_texture_width; | ||||
|  |  | |||
|  | @ -786,7 +786,6 @@ sub remove { | |||
|     splice @{$self->{objects}}, $obj_idx, 1; | ||||
|     $self->{model}->delete_object($obj_idx); | ||||
|     $self->{print}->delete_object($obj_idx); | ||||
|     $self->{gcode_preview_data}->reset; | ||||
|     $self->{list}->DeleteItem($obj_idx); | ||||
|     $self->object_list_changed; | ||||
|      | ||||
|  | @ -807,7 +806,6 @@ sub reset { | |||
|     @{$self->{objects}} = (); | ||||
|     $self->{model}->clear_objects; | ||||
|     $self->{print}->clear_objects; | ||||
|     $self->{gcode_preview_data}->reset; | ||||
|     $self->{list}->DeleteAllItems; | ||||
|     $self->object_list_changed; | ||||
|      | ||||
|  | @ -1161,6 +1159,7 @@ sub async_apply_config { | |||
|     # Reset preview canvases. If the print has been invalidated, the preview canvases will be cleared. | ||||
|     # Otherwise they will be just refreshed. | ||||
|     if ($invalidated) { | ||||
|         $self->{gcode_preview_data}->reset; | ||||
|         $self->{toolpaths2D}->reload_print if $self->{toolpaths2D}; | ||||
|         $self->{preview3D}->reload_print if $self->{preview3D}; | ||||
|     } | ||||
|  | @ -1267,8 +1266,6 @@ sub reslice { | |||
|         $self->stop_background_process; | ||||
|         # Rather perform one additional unnecessary update of the print object instead of skipping a pending async update. | ||||
|         $self->async_apply_config; | ||||
|         # Reset gcode data | ||||
|         $self->{gcode_preview_data}->reset; | ||||
|         $self->statusbar->SetCancelCallback(sub { | ||||
|             $self->stop_background_process; | ||||
|             $self->statusbar->SetStatusText("Slicing cancelled"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bubnikv
						bubnikv