mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Keep pointer to PrintConfig instead of copying it.
This commit is contained in:
		
							parent
							
								
									c2b249d059
								
							
						
					
					
						commit
						d824de6168
					
				
					 2 changed files with 3 additions and 4 deletions
				
			
		|  | @ -7,7 +7,7 @@ namespace Slic3r { | |||
| 
 | ||||
| Extruder::Extruder(int id, PrintConfig *config) | ||||
| :   id(id), | ||||
|     config(*config) // make a copy
 | ||||
|     config(config) | ||||
| { | ||||
|     reset(); | ||||
| } | ||||
|  | @ -37,7 +37,7 @@ bool | |||
| Extruder::use_relative_e_distances() const | ||||
| { | ||||
|     // TODO: figure out way to avoid static_cast to access hidden const method
 | ||||
|     const ConfigOption *opt = static_cast<const ConfigBase*>(&this->config) | ||||
|     const ConfigOption *opt = static_cast<const ConfigBase*>(this->config) | ||||
|         ->option("use_relative_e_distances"); | ||||
|     return *static_cast<const ConfigOptionBool*>(opt); | ||||
| } | ||||
|  |  | |||
|  | @ -23,8 +23,7 @@ class Extruder | |||
|     double retracted; | ||||
|     double restart_extra; | ||||
| 
 | ||||
|     // TODO: maybe better to keep a reference to an existing object than copy it
 | ||||
|     PrintConfig config; | ||||
|     PrintConfig *config; | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Y. Sapir
						Y. Sapir