Skip to content

Commit

Permalink
Fix for #12877 - Color Change Added After Moving Slider
Browse files Browse the repository at this point in the history
+ Fixed update of the ruler, when it was hidden and than shown
+ Added messed include in RulerForDoubleSlider.cpp (#12882)
+ Fixed some warnings
  • Loading branch information
YuSanka authored and lukasmatena committed Jun 24, 2024
1 parent 34346c9 commit 1c0cb70
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/slic3r/GUI/DoubleSliderForLayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,7 @@ void DSForLayers::Render(const int canvas_width, const int canvas_height, float

void DSForLayers::force_ruler_update()
{
if (m_show_ruler)
m_ruler.invalidate();
m_ruler.invalidate();
}

bool DSForLayers::is_wipe_tower_layer(int tick) const
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GUI_Preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ void Preview::create_sliders()

m_layers_slider->set_callback_on_thumb_move( [this]() -> void { Preview::on_layers_slider_scroll_changed(); } );

m_layers_slider->set_callback_on_change_app_config([this](const std::string& key, const std::string& val) -> void {
m_layers_slider->set_callback_on_change_app_config([](const std::string& key, const std::string& val) -> void {
wxGetApp().app_config->set(key, val);
});

Expand Down
8 changes: 7 additions & 1 deletion src/slic3r/GUI/ImGuiDoubleSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ bool ImGuiControl::draw_slider( int* higher_pos, int* lower_pos,
m_lclick_on_selected_thumb = true;
}
}

if (ImGui::ItemHoverable(active_thumb, id) && ImGui::IsMouseDragging(0)) {
// invalidate active thumb clicking
m_active_thumb = ImRect(0.f, 0.f, 0.f, 0.f);
}
}

// update thumb position
Expand Down Expand Up @@ -621,7 +626,8 @@ bool ImGuiControl::draw_slider( int* higher_pos, int* lower_pos,
}

// draw label on mouse move
draw_label(move_label, mouse_pos_rc, false, true);
if (m_show_move_label)
draw_label(move_label, mouse_pos_rc, false, true);

return pos_changed;
}
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/RulerForDoubleSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
///|/
#include "RulerForDoubleSlider.hpp"
#include "libslic3r/CustomGCode.hpp"
#include "libslic3r/libslic3r.h"

using namespace Slic3r;
using namespace CustomGCode;
Expand Down

0 comments on commit 1c0cb70

Please sign in to comment.