diff options
author | enricoturri1966 <enricoturri@seznam.cz> | 2020-08-12 09:10:54 +0300 |
---|---|---|
committer | enricoturri1966 <enricoturri@seznam.cz> | 2020-08-12 09:10:54 +0300 |
commit | 176f7cd6df7cb03e630f6c4addb7d1b2856eb6e8 (patch) | |
tree | 51c8cd66e221e073101eb1fcdf9d001ae3eecc9d /src/slic3r/GUI | |
parent | 4ca026d4b6ecfbb11bd8107a427bdbe86cfdc28e (diff) | |
parent | a6a5025a7600be41c305567ed16acfdf703194e4 (diff) |
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_gcode_viewer
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r-- | src/slic3r/GUI/PresetComboBoxes.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 33ae4f54e..7539f3616 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -517,7 +517,7 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset const Preset* selected_preset = m_collection->find_preset(m_preset_bundle->filament_presets[m_extruder_idx]); // Wide icons are shown if the currently selected preset is not compatible with the current printer, // and red flag is drown in front of the selected preset. - bool wide_icons = selected_preset != nullptr && !selected_preset->is_compatible; + bool wide_icons = selected_preset && !selected_preset->is_compatible; float scale = m_em_unit*0.1f; int shifl_Left = wide_icons ? int(scale * 16 + 0.5) : 0; @@ -707,10 +707,11 @@ void PlaterPresetComboBox::update() assert(selected_filament_preset); } - const Preset& selected_preset = m_type == Preset::TYPE_FILAMENT ? *selected_filament_preset : m_collection->get_selected_preset(); + bool has_selection = m_collection->get_selected_idx() != size_t(-1); + const Preset* selected_preset = m_type == Preset::TYPE_FILAMENT ? selected_filament_preset : has_selection ? &m_collection->get_selected_preset() : nullptr; // Show wide icons if the currently selected preset is not compatible with the current printer, // and draw a red flag in front of the selected preset. - bool wide_icons = !selected_preset.is_compatible; + bool wide_icons = selected_preset && !selected_preset->is_compatible; std::map<wxString, wxBitmap*> nonsys_presets; |