Fixed behaviour of float sliders in SLA gizmos,

which was broken after the 'Edit' button was added.
This is a bit hacky fix, it might be worth improving later.
This commit is contained in:
Lukas Matena 2021-12-08 13:07:56 +01:00
parent e9b9c48cae
commit 06fd732b57
4 changed files with 43 additions and 27 deletions

View file

@ -503,6 +503,12 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float
str_label = str_label.substr(0, pos) + str_label.substr(pos + 2);
bool ret = ImGui::SliderFloat(str_label.c_str(), v, v_min, v_max, format, power);
m_last_slider_status.hovered = ImGui::IsItemHovered();
m_last_slider_status.edited = ImGui::IsItemEdited();
m_last_slider_status.clicked = ImGui::IsItemClicked();
m_last_slider_status.deactivated_after_edit = ImGui::IsItemDeactivatedAfterEdit();
if (!tooltip.empty() && ImGui::IsItemHovered())
this->tooltip(into_u8(tooltip).c_str(), max_tooltip_width);