mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Fixed interference between tooltips and imgui dialogs
This commit is contained in:
parent
a85a2b2e2a
commit
1c1a6b933a
2 changed files with 11 additions and 4 deletions
|
@ -3309,13 +3309,19 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
|
|
||||||
Point pos(evt.GetX(), evt.GetY());
|
Point pos(evt.GetX(), evt.GetY());
|
||||||
|
|
||||||
ImGuiWrapper *imgui = wxGetApp().imgui();
|
ImGuiWrapper* imgui = wxGetApp().imgui();
|
||||||
if (imgui->update_mouse_data(evt)) {
|
if (imgui->update_mouse_data(evt)) {
|
||||||
m_mouse.position = evt.Leaving() ? Vec2d(-1.0, -1.0) : pos.cast<double>();
|
m_mouse.position = evt.Leaving() ? Vec2d(-1.0, -1.0) : pos.cast<double>();
|
||||||
render();
|
render();
|
||||||
#ifdef SLIC3R_DEBUG_MOUSE_EVENTS
|
#ifdef SLIC3R_DEBUG_MOUSE_EVENTS
|
||||||
printf((format_mouse_event_debug_message(evt) + " - Consumed by ImGUI\n").c_str());
|
printf((format_mouse_event_debug_message(evt) + " - Consumed by ImGUI\n").c_str());
|
||||||
#endif /* SLIC3R_DEBUG_MOUSE_EVENTS */
|
#endif /* SLIC3R_DEBUG_MOUSE_EVENTS */
|
||||||
|
// do not return if dragging or tooltip not empty to allow for tooltip update
|
||||||
|
#if ENABLE_CANVAS_TOOLTIP_USING_IMGUI
|
||||||
|
if (!m_mouse.dragging && m_tooltip.is_empty())
|
||||||
|
#else
|
||||||
|
if (!m_mouse.dragging && m_canvas->GetToolTipText().empty())
|
||||||
|
#endif // ENABLE_CANVAS_TOOLTIP_USING_IMGUI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -401,6 +401,7 @@ private:
|
||||||
#endif // ENABLE_CANVAS_DELAYED_TOOLTIP_USING_IMGUI
|
#endif // ENABLE_CANVAS_DELAYED_TOOLTIP_USING_IMGUI
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool is_empty() const { return m_text.empty(); }
|
||||||
#if ENABLE_CANVAS_DELAYED_TOOLTIP_USING_IMGUI
|
#if ENABLE_CANVAS_DELAYED_TOOLTIP_USING_IMGUI
|
||||||
void set_text(const std::string& text);
|
void set_text(const std::string& text);
|
||||||
void render(const Vec2d& mouse_position, GLCanvas3D& canvas) const;
|
void render(const Vec2d& mouse_position, GLCanvas3D& canvas) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue