Fix of #1976
This commit is contained in:
parent
f249155340
commit
4a8a1fac7b
@ -559,14 +559,13 @@ static int find_close_layer_idx(const std::vector<double>& zs, double &z, double
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Preview::update_double_slider(const std::vector<double>& layers_z, bool force_sliders_full_range)
|
||||
void Preview::update_double_slider(const std::vector<double>& layers_z)
|
||||
{
|
||||
// Save the initial slider span.
|
||||
double z_low = m_slider->GetLowerValueD();
|
||||
double z_high = m_slider->GetHigherValueD();
|
||||
bool was_empty = m_slider->GetMaxValue() == 0;
|
||||
bool span_changed = layers_z.empty() || std::abs(layers_z.back() - m_slider->GetMaxValueD()) > 1e-6;
|
||||
force_sliders_full_range |= was_empty | span_changed;
|
||||
bool force_sliders_full_range = was_empty;
|
||||
bool snap_to_min = force_sliders_full_range || m_slider->is_lower_at_min();
|
||||
bool snap_to_max = force_sliders_full_range || m_slider->is_higher_at_max();
|
||||
|
||||
|
@ -138,7 +138,7 @@ private:
|
||||
|
||||
// Create/Update/Reset double slider on 3dPreview
|
||||
void create_double_slider();
|
||||
void update_double_slider(const std::vector<double>& layers_z, bool force_sliders_full_range = false);
|
||||
void update_double_slider(const std::vector<double>& layers_z);
|
||||
void fill_slider_values(std::vector<std::pair<int, double>> &values,
|
||||
const std::vector<double> &layers_z);
|
||||
void reset_double_slider();
|
||||
|
Loading…
Reference in New Issue
Block a user