Fixed update on reset of the variable layer height profile.

Fixed update of the layer height profile on PrintObject when changing profiles.
Fixed crash due to the layer height editing refactoring & wipe tower.
This commit is contained in:
bubnikv 2019-01-23 14:00:03 +01:00
parent 94b5f9c567
commit 0af11c51e3
6 changed files with 83 additions and 52 deletions

View file

@ -1179,11 +1179,12 @@ void GLCanvas3D::LayersEditing::adjust_layer_height_profile()
m_layers_texture.valid = false;
}
void GLCanvas3D::LayersEditing::reset_layer_height_profile()
void GLCanvas3D::LayersEditing::reset_layer_height_profile(GLCanvas3D& canvas)
{
const_cast<ModelObject*>(m_model_object)->layer_height_profile.clear();
m_layer_height_profile.clear();
m_layers_texture.valid = false;
canvas.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
}
void GLCanvas3D::LayersEditing::generate_layer_height_texture()
@ -5117,7 +5118,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
if (evt.LeftDown())
{
// A volume is selected and the mouse is inside the reset button. Reset the ModelObject's layer height profile.
m_layers_editing.reset_layer_height_profile();
m_layers_editing.reset_layer_height_profile(*this);
// Index 2 means no editing, just wait for mouse up event.
m_layers_editing.state = LayersEditing::Completed;