FIX: preview model display problem after tick changed

Change-Id: I1d17fe1b19d323642ad2aff0329c919a627dc3fc
This commit is contained in:
liz.li 2023-02-17 16:46:01 +08:00 committed by Lane.Wei
parent 0576e3e4fd
commit 9a18e4e54b
2 changed files with 4 additions and 3 deletions

View File

@ -706,7 +706,8 @@ void Preview::load_print_as_fff(bool keep_z_range, bool only_gcode)
if (IsShown()) {
m_canvas->set_selected_extruder(0);
if (gcode_preview_data_valid) {
bool is_slice_result_valid = wxGetApp().plater()->get_partplate_list().get_curr_plate()->is_slice_result_valid();
if (gcode_preview_data_valid && is_slice_result_valid) {
// Load the real G-code preview.
//BBS: add more log
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": will load gcode_preview from result, moves count %1%") % m_gcode_result->moves.size();

View File

@ -2428,8 +2428,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
//BBS: replace model custom gcode with current plate custom gcode
model.plates_custom_gcodes[model.curr_plate_index] = preview->get_canvas3d()->get_gcode_viewer().get_layers_slider()->GetTicksValues();
preview->on_tick_changed(tick_event_type);
// BBS set to invalid state only
if (tick_event_type == Type::ToolChange || tick_event_type == Type::Custom || tick_event_type == Type::Template || tick_event_type == Type::PausePrint) {
PartPlate *plate = this->q->get_partplate_list().get_curr_plate();
@ -2438,6 +2436,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
}
}
preview->on_tick_changed(tick_event_type);
// update slice and print button
wxGetApp().mainframe->update_slice_print_status(MainFrame::SlicePrintEventType::eEventSliceUpdate, true, false);
set_need_update(true);