ObjectList: Fixed mouse click on the WarningIcon, when mesh wasn't repaired and isn't manifold.

This commit is contained in:
YuSanka 2021-10-06 10:12:21 +02:00
parent 9e2fa3cd4d
commit 47b54d5ce0
3 changed files with 12 additions and 1 deletions

View file

@ -904,7 +904,7 @@ void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_me
int obj_idx, vol_idx;
get_selected_item_indexes(obj_idx, vol_idx, item);
if (get_mesh_errors_count(obj_idx, vol_idx) > 0 &&
if (m_objects_model->HasWarningIcon(item) &&
mouse_pos.x > 2 * wxGetApp().em_unit() && mouse_pos.x < 4 * wxGetApp().em_unit())
fix_through_netfabb();
}

View file

@ -1777,6 +1777,15 @@ void ObjectDataViewModel::DeleteWarningIcon(const wxDataViewItem& item, const bo
}
}
bool ObjectDataViewModel::HasWarningIcon(const wxDataViewItem& item) const
{
if (!item.IsOk())
return false;
ObjectDataViewModelNode *node = static_cast<ObjectDataViewModelNode*>(item.GetID());
return node->has_warning_icon();
}
} // namespace GUI
} // namespace Slic3r

View file

@ -240,6 +240,7 @@ public:
bool valid();
#endif /* NDEBUG */
bool invalid() const { return m_idx < -1; }
bool has_warning_icon() const { return !m_warning_icon_name.empty(); }
private:
friend class ObjectDataViewModel;
@ -388,6 +389,7 @@ public:
const std::string& warning_icon_name = std::string());
void AddWarningIcon(const wxDataViewItem& item, const std::string& warning_name);
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
bool HasWarningIcon(const wxDataViewItem& item) const;
t_layer_height_range GetLayerRangeByItem(const wxDataViewItem& item) const;
bool UpdateColumValues(unsigned col);