mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 07:35:56 +08:00
ImGuiDoubleSlider: Fixed flickering on moving of the overlapped thumbs
+ Hide sliders after theirs creation
This commit is contained in:
parent
2241c4d9d5
commit
35e736a8e5
@ -534,6 +534,10 @@ void Preview::create_sliders()
|
|||||||
// m_canvas_widget
|
// m_canvas_widget
|
||||||
m_canvas_widget->Bind(wxEVT_KEY_DOWN, &Preview::update_sliders_from_canvas, this);
|
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);
|
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>.
|
// Find an index of a value in a sorted vector, which is in <z-eps, z+eps>.
|
||||||
|
@ -414,12 +414,12 @@ void ImGuiControl::check_and_correct_thumbs(int* higher_pos, int* lower_pos)
|
|||||||
if (is_horizontal()) {
|
if (is_horizontal()) {
|
||||||
if (lower_thumb_center_pos + thumb_radius > higher_thumb_center_pos) {
|
if (lower_thumb_center_pos + thumb_radius > higher_thumb_center_pos) {
|
||||||
if (m_selection == ssHigher) {
|
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);
|
m_regions.higher_thumb.TranslateX(thumb_radius);
|
||||||
*lower_pos = *higher_pos;
|
*lower_pos = *higher_pos;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_regions.higher_thumb = m_regions.lower_thumb;
|
m_regions.lower_thumb = m_regions.higher_thumb;
|
||||||
m_regions.lower_thumb.TranslateX(-thumb_radius);
|
m_regions.lower_thumb.TranslateX(-thumb_radius);
|
||||||
*higher_pos = *lower_pos;
|
*higher_pos = *lower_pos;
|
||||||
}
|
}
|
||||||
@ -434,7 +434,7 @@ void ImGuiControl::check_and_correct_thumbs(int* higher_pos, int* lower_pos)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_regions.higher_thumb = m_regions.lower_thumb;
|
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;
|
*higher_pos = *lower_pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -753,8 +753,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||||||
q->Layout();
|
q->Layout();
|
||||||
|
|
||||||
set_current_panel(wxGetApp().is_editor() ? static_cast<wxPanel*>(view3D) : static_cast<wxPanel*>(preview));
|
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
|
// updates camera type from .ini file
|
||||||
camera.enable_update_config_on_type_change(true);
|
camera.enable_update_config_on_type_change(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user