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

@ -39,6 +39,13 @@ class ImGuiWrapper
std::string m_clipboard_text;
public:
struct LastSliderStatus {
bool hovered { false };
bool edited { false };
bool clicked { false };
bool deactivated_after_edit { false };
};
ImGuiWrapper();
~ImGuiWrapper();
@ -63,6 +70,7 @@ public:
ImVec2 get_item_spacing() const;
float get_slider_float_height() const;
const LastSliderStatus& get_last_slider_status() const { return m_last_slider_status; }
void set_next_window_pos(float x, float y, int flag, float pivot_x = 0.0f, float pivot_y = 0.0f);
void set_next_window_bg_alpha(float alpha);
@ -146,6 +154,8 @@ private:
static const char* clipboard_get(void* user_data);
static void clipboard_set(void* user_data, const char* text);
LastSliderStatus m_last_slider_status;
};