Skip to content

Commit

Permalink
Trigger change in project upon layer-specific gcode changes (Fixes #4261
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSlashEffect authored and supermerill committed Jun 29, 2024
1 parent c5ecd87 commit 374fc61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/slic3r/GUI/GUI_Preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,15 @@ wxBoxSizer* Preview::create_layers_slider_sizer()
Bind(DoubleSlider::wxCUSTOMEVT_TICKSCHANGED, [this](wxEvent&) {
Model& model = wxGetApp().plater()->model();
Info custom_gcode_per_print_z = m_layers_slider->GetTicksValues();
auto num_of_old_gcodes = model.custom_gcode_per_print_z.gcodes.size();
model.custom_gcode_per_print_z = custom_gcode_per_print_z;
m_schedule_background_process();
std::string operation_message = (num_of_old_gcodes == model.custom_gcode_per_print_z.gcodes.size()) ? "Edit" :
(num_of_old_gcodes < model.custom_gcode_per_print_z.gcodes.size()) ? "Add" :
"Remove";

m_schedule_background_process();
wxGetApp().plater()->take_snapshot(from_u8(
(boost::format(_utf8(L("Change layer gcode: %s element"))) % operation_message).str()));
m_keep_current_preview_type = false;
reload_print(false);
});
Expand Down

0 comments on commit 374fc61

Please sign in to comment.