mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Fixed ObjectList::last_volume_is_deleted() to avoid clearing volume[0].config after undo/redo
This commit is contained in:
		
							parent
							
								
									a121253520
								
							
						
					
					
						commit
						804e1b1939
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		|  | @ -1741,7 +1741,7 @@ void ObjectList::del_subobject_item(wxDataViewItem& item) | |||
|     ItemType type; | ||||
| 
 | ||||
|     m_objects_model->GetItemInfo(item, type, obj_idx, idx); | ||||
|     if (type & itUndef) | ||||
|     if (type == itUndef) | ||||
|         return; | ||||
| 
 | ||||
|     if (type & itSettings) | ||||
|  | @ -3101,7 +3101,7 @@ void ObjectList::change_part_type() | |||
| void ObjectList::last_volume_is_deleted(const int obj_idx) | ||||
| { | ||||
| 
 | ||||
|     if (obj_idx < 0 || obj_idx >= m_objects->size() || (*m_objects)[obj_idx]->volumes.empty()) | ||||
|     if (obj_idx < 0 || obj_idx >= m_objects->size() || (*m_objects)[obj_idx]->volumes.size() != 1) | ||||
|         return; | ||||
| 
 | ||||
|     auto volume = (*m_objects)[obj_idx]->volumes.front(); | ||||
|  |  | |||
|  | @ -1508,7 +1508,7 @@ ItemType ObjectDataViewModel::GetItemType(const wxDataViewItem &item) const | |||
|     if (!item.IsOk()) | ||||
|         return itUndef; | ||||
|     ObjectDataViewModelNode *node = (ObjectDataViewModelNode*)item.GetID(); | ||||
|     return node->m_type; | ||||
|     return node->m_type < 0 ? itUndef : node->m_type; | ||||
| } | ||||
| 
 | ||||
| wxDataViewItem ObjectDataViewModel::GetItemByType(const wxDataViewItem &parent_item, ItemType type) const  | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka