Fixed crash when moving horizontal slider thumb in preview with no toolpath active

This commit is contained in:
enricoturri1966 2020-10-07 13:38:21 +02:00
parent 9e0e597284
commit 2ecd78b0d5
5 changed files with 25 additions and 6 deletions

View file

@ -1162,8 +1162,7 @@ void Preview::update_moves_slider()
std::vector<double> values(view.endpoints.last - view.endpoints.first + 1);
unsigned int count = 0;
for (unsigned int i = view.endpoints.first; i <= view.endpoints.last; ++i)
{
for (unsigned int i = view.endpoints.first; i <= view.endpoints.last; ++i) {
values[count++] = static_cast<double>(i + 1);
}
@ -1171,6 +1170,12 @@ void Preview::update_moves_slider()
m_moves_slider->SetMaxValue(view.endpoints.last - view.endpoints.first);
m_moves_slider->SetSelectionSpan(view.current.first - view.endpoints.first, view.current.last - view.endpoints.first);
}
void Preview::enable_moves_slider(bool enable)
{
if (m_moves_slider != nullptr)
m_moves_slider->Enable(enable);
}
#else
void Preview::update_double_slider_from_canvas(wxKeyEvent & event)
{