Skip to content

Commit

Permalink
fix doubleslider nan
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Dec 29, 2023
1 parent 200c24a commit 81bbbd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/slic3r/GUI/DoubleSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]) {
Expand All @@ -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);
}

Expand Down

0 comments on commit 81bbbd1

Please sign in to comment.