From 795ec50eb4a7a036c9792ced7df1cc22c9efb474 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Tue, 14 May 2024 12:32:34 +0800 Subject: [PATCH] FIX:return bar pos only been modified in 3d view jira: none Change-Id: I353b2245f8032707c593985eff20bbecc6905525 (cherry picked from commit 01bbdc0b303ab3832e88c580159e73aedd80b929) --- src/slic3r/GUI/GLCanvas3D.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 3be4c126f..c23b769f9 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -7991,13 +7991,15 @@ void GLCanvas3D::_render_return_toolbar() float window_pos_x = 30.0f; float window_pos_y = 14.0f; {//solve ui overlap issue - float zoom = (float) wxGetApp().plater()->get_camera().get_zoom(); - float left_pos = m_main_toolbar.get_item("add")->render_left_pos; - const float toolbar_x = 0.5 * canvas_w + left_pos * zoom; - const float margin = 5; - if (toolbar_x < window_width + margin * 3) { - window_pos_x = 5.0f; - window_pos_y = m_main_toolbar.get_height() + 2.0f; + if (m_canvas_type == ECanvasType::CanvasView3D) { + float zoom = (float) wxGetApp().plater()->get_camera().get_zoom(); + float left_pos = m_main_toolbar.get_item("add")->render_left_pos; + const float toolbar_x = 0.5 * canvas_w + left_pos * zoom; + const float margin = 5; + if (toolbar_x < window_width + margin * 3) { + window_pos_x = 5.0f; + window_pos_y = m_main_toolbar.get_height() + 2.0f; + } } } imgui.set_next_window_pos(window_pos_x, window_pos_y, ImGuiCond_Always, 0, 0);