Skip to content

Commit

Permalink
simplify conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
yw4z committed May 18, 2024
1 parent a3da5d2 commit 85510f8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/slic3r/GUI/ObjectDataViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,17 +558,19 @@ void ObjectDataViewModel::UpdateBitmapForNode(ObjectDataViewModelNode *node)
std::vector<wxBitmap> bmps;
if (node->has_warning_icon())
bmps.emplace_back(node->warning_icon_name() == WarningIcon ? m_warning_bmp : m_warning_manifold_bmp);
if (node->has_warning_icon() && node->has_lock()) // ORCA: Add spacing between icons if there are multiple
bmps.emplace_back(create_scaled_bitmap("dot", nullptr, int(wxGetApp().em_unit() / 10) * 4));
if (node->has_lock())
if (node->has_lock()) {
if (!bmps.empty()) // ORCA: Add spacing between icons if there are multiple
bmps.emplace_back(create_scaled_bitmap("dot", nullptr, int(wxGetApp().em_unit() / 10) * 4));
bmps.emplace_back(m_lock_bmp);
if (is_volume_node && (node->has_lock() || node->has_warning_icon())) // ORCA: Add spacing between icons if there are multiple
bmps.emplace_back(create_scaled_bitmap("dot", nullptr, int(wxGetApp().em_unit() / 10) * 4));
if (is_volume_node)
}
if (is_volume_node) {
if (!bmps.empty()) // ORCA: Add spacing between icons if there are multiple
bmps.emplace_back(create_scaled_bitmap("dot", nullptr, int(wxGetApp().em_unit() / 10) * 4));
bmps.emplace_back(
node->is_text_volume() ? m_text_volume_bmps[vol_type] :
node->is_svg_volume() ? m_svg_volume_bmps[vol_type] :
m_volume_bmps[vol_type]);
}
bmp = m_bitmap_cache->insert(scaled_bitmap_name, bmps);
}

Expand Down

0 comments on commit 85510f8

Please sign in to comment.