Fixed delayed update of 3D scene when moving preview layers' slider (as reported in #1250)
This commit is contained in:
parent
e358dd9c01
commit
e354a306e6
3 changed files with 11 additions and 6 deletions
|
@ -533,6 +533,7 @@ void Preview::create_double_slider()
|
|||
|
||||
m_slider->Bind(wxEVT_SCROLL_CHANGED, &Preview::on_sliders_scroll_changed, this);
|
||||
|
||||
|
||||
Bind(wxCUSTOMEVT_TICKSCHANGED, [this](wxEvent&) {
|
||||
auto& config = wxGetApp().preset_bundle->project_config;
|
||||
((config.option<ConfigOptionFloats>("colorprint_heights"))->values) = (m_slider->GetTicksValues());
|
||||
|
@ -823,7 +824,7 @@ void Preview::load_print_as_sla()
|
|||
}
|
||||
}
|
||||
|
||||
void Preview::on_sliders_scroll_changed(wxEvent& event)
|
||||
void Preview::on_sliders_scroll_changed(wxCommandEvent& event)
|
||||
{
|
||||
if (IsShown())
|
||||
{
|
||||
|
@ -831,7 +832,7 @@ void Preview::on_sliders_scroll_changed(wxEvent& event)
|
|||
if (tech == ptFFF)
|
||||
{
|
||||
m_canvas->set_toolpaths_range(m_slider->GetLowerValueD() - 1e-6, m_slider->GetHigherValueD() + 1e-6);
|
||||
m_canvas_widget->Refresh();
|
||||
m_canvas->render();
|
||||
m_canvas->set_use_clipping_planes(false);
|
||||
}
|
||||
else if (tech == ptSLA)
|
||||
|
@ -839,10 +840,11 @@ void Preview::on_sliders_scroll_changed(wxEvent& event)
|
|||
m_canvas->set_clipping_plane(0, ClippingPlane(Vec3d::UnitZ(), -m_slider->GetLowerValueD()));
|
||||
m_canvas->set_clipping_plane(1, ClippingPlane(-Vec3d::UnitZ(), m_slider->GetHigherValueD()));
|
||||
m_canvas->set_use_clipping_planes(m_slider->GetHigherValue() != 0);
|
||||
m_canvas_widget->Refresh();
|
||||
m_canvas->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
|
|
@ -154,7 +154,7 @@ private:
|
|||
void load_print_as_fff(bool keep_z_range = false);
|
||||
void load_print_as_sla();
|
||||
|
||||
void on_sliders_scroll_changed(wxEvent& event);
|
||||
void on_sliders_scroll_changed(wxCommandEvent& event);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -2235,14 +2235,16 @@ void DoubleSlider::OnMotion(wxMouseEvent& event)
|
|||
}
|
||||
else if (m_is_left_down || m_is_right_down) {
|
||||
if (m_selection == ssLower) {
|
||||
int current_value = m_lower_value;
|
||||
m_lower_value = get_value_from_position(pos.x, pos.y);
|
||||
correct_lower_value();
|
||||
action = true;
|
||||
action = (current_value != m_lower_value);
|
||||
}
|
||||
else if (m_selection == ssHigher) {
|
||||
int current_value = m_higher_value;
|
||||
m_higher_value = get_value_from_position(pos.x, pos.y);
|
||||
correct_higher_value();
|
||||
action = true;
|
||||
action = (current_value != m_higher_value);
|
||||
}
|
||||
}
|
||||
Refresh();
|
||||
|
@ -2253,6 +2255,7 @@ void DoubleSlider::OnMotion(wxMouseEvent& event)
|
|||
{
|
||||
wxCommandEvent e(wxEVT_SCROLL_CHANGED);
|
||||
e.SetEventObject(this);
|
||||
e.SetString("moving");
|
||||
ProcessWindowEvent(e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue