From 81bbbd17673369cc339b757b1581475005da2ede Mon Sep 17 00:00:00 2001 From: supermerill Date: Fri, 29 Dec 2023 02:35:14 +0100 Subject: [PATCH] fix doubleslider nan --- src/slic3r/GUI/DoubleSlider.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index c9fedc22575..9a1a7781998 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -1190,8 +1190,9 @@ void Control::draw_ruler(wxDC& dc) if (m_values[tick] < value) break; // short ticks from the last tick to the end of current sequence - assert(! std::isnan(short_tick)); - draw_short_ticks(dc, short_tick, tick); + //note: first sequence can be empty. + if(!std::isnan(short_tick)); + draw_short_ticks(dc, short_tick, tick); if (sequence < m_ruler.count() - 1) sequence++; } short_tick = tick; @@ -1215,6 +1216,7 @@ void Control::draw_ruler(wxDC& dc) prev_y_pos = pos; } + assert(!std::isnan(short_tick)); draw_short_ticks(dc, short_tick, tick); if (value == m_ruler.max_values[sequence]) { @@ -1224,6 +1226,7 @@ void Control::draw_ruler(wxDC& dc) } } // short ticks from the last tick to the end + assert(!std::isnan(short_tick)); draw_short_ticks(dc, short_tick, m_max_value); }