From e8b2fa3a32fc996085c0f7cf7e7bf1330d15d01e Mon Sep 17 00:00:00 2001 From: Derrick Date: Mon, 9 Mar 2026 18:22:37 +0800 Subject: [PATCH] Fix zoom button tooltip width miscalculation (#12692) wx strings to be converted to utf-8 before doing width calculation for consistency. JIRA-127 --- src/slic3r/GUI/GLCanvas3D.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index ee7fedea11..452c4301a3 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -8545,9 +8545,11 @@ void GLCanvas3D::_render_canvas_toolbar() zoom_to_selection(); } } else if (ImGui::IsItemHovered()) { - auto tooltip = _L("Fit camera to scene or selected object."); - auto width = ImGui::CalcTextSize(tooltip.c_str()).x + imgui.scaled(2.0f); - imgui.tooltip(tooltip, width); + auto tooltip_str_wx = _L("Fit camera to scene or selected object."); + std::string tooltip_str = tooltip_str_wx.ToUTF8().data(); + + float width = ImGui::CalcTextSize(tooltip_str.c_str()).x + imgui.scaled(2.0f); + imgui.tooltip(tooltip_str, width); } }