ImGuiDoubleSlider: Fixed flickering on moving of the overlapped thumbs

+ Hide sliders after theirs creation
This commit is contained in:
YuSanka 2024-04-26 09:34:42 +02:00 committed by Lukas Matena
parent 2241c4d9d5
commit 35e736a8e5
3 changed files with 7 additions and 5 deletions

View File

@ -534,6 +534,10 @@ void Preview::create_sliders()
// m_canvas_widget
m_canvas_widget->Bind(wxEVT_KEY_DOWN, &Preview::update_sliders_from_canvas, this);
m_canvas_widget->Bind(EVT_GLCANVAS_SLIDERS_MANIPULATION, &Preview::update_sliders_from_canvas, this);
// Hide sliders from the very begibing. Visibility will be set later
m_layers_slider->Hide();
m_moves_slider->Hide();
}
// Find an index of a value in a sorted vector, which is in <z-eps, z+eps>.

View File

@ -414,12 +414,12 @@ void ImGuiControl::check_and_correct_thumbs(int* higher_pos, int* lower_pos)
if (is_horizontal()) {
if (lower_thumb_center_pos + thumb_radius > higher_thumb_center_pos) {
if (m_selection == ssHigher) {
m_regions.lower_thumb = m_regions.higher_thumb;
m_regions.higher_thumb = m_regions.lower_thumb;
m_regions.higher_thumb.TranslateX(thumb_radius);
*lower_pos = *higher_pos;
}
else {
m_regions.higher_thumb = m_regions.lower_thumb;
m_regions.lower_thumb = m_regions.higher_thumb;
m_regions.lower_thumb.TranslateX(-thumb_radius);
*higher_pos = *lower_pos;
}
@ -434,7 +434,7 @@ void ImGuiControl::check_and_correct_thumbs(int* higher_pos, int* lower_pos)
}
else {
m_regions.higher_thumb = m_regions.lower_thumb;
m_regions.lower_thumb.TranslateY(-thumb_radius);
m_regions.higher_thumb.TranslateY(-thumb_radius);
*higher_pos = *lower_pos;
}
}

View File

@ -753,8 +753,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
q->Layout();
set_current_panel(wxGetApp().is_editor() ? static_cast<wxPanel*>(view3D) : static_cast<wxPanel*>(preview));
if (wxGetApp().is_gcode_viewer())
preview->hide_layers_slider();
// updates camera type from .ini file
camera.enable_update_config_on_type_change(true);