mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	Tolerate corrupted appconfig settings for auto rotation
This commit is contained in:
		
							parent
							
								
									e7f5c61bb8
								
							
						
					
					
						commit
						33eec05f02
					
				
					 1 changed files with 11 additions and 4 deletions
				
			
		|  | @ -217,11 +217,18 @@ void GLGizmoRotate3D::load_rotoptimize_state() | ||||||
|     std::string method_str = |     std::string method_str = | ||||||
|         wxGetApp().app_config->get("rotoptimize", "method_id"); |         wxGetApp().app_config->get("rotoptimize", "method_id"); | ||||||
| 
 | 
 | ||||||
|     if (!accuracy_str.empty()) |     if (!accuracy_str.empty()) { | ||||||
|         m_rotoptimizewin_state.accuracy = std::stof(accuracy_str); |         float accuracy = std::stof(accuracy_str); | ||||||
|  |         accuracy = std::max(0.f, std::min(accuracy, 1.f)); | ||||||
| 
 | 
 | ||||||
|     if (!method_str.empty()) |         m_rotoptimizewin_state.accuracy = accuracy; | ||||||
|         m_rotoptimizewin_state.method_id = std::stoi(method_str); |     } | ||||||
|  | 
 | ||||||
|  |     if (!method_str.empty()) { | ||||||
|  |         int method_id = std::stoi(method_str); | ||||||
|  |         if (method_id < int(RotoptimizeJob::get_methods_count())) | ||||||
|  |             m_rotoptimizewin_state.method_id = method_id; | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void GLGizmoRotate::render_circle() const | void GLGizmoRotate::render_circle() const | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tamasmeszaros
						tamasmeszaros