From b83e4d28903636c5612f7cc2db65b37f7dc9ef64 Mon Sep 17 00:00:00 2001 From: yw4z Date: Fri, 9 Oct 2026 13:33:28 +0300 Subject: [PATCH] fix build --- src/slic3r/GUI/OG_CustomCtrl.cpp | 11 ++++------- src/slic3r/GUI/OG_CustomCtrl.hpp | 5 +++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 97531e3492..23f61b5edc 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -8,7 +8,6 @@ #include #include #include -#include "slic3r/GUI/wxExtensions.hpp" #include #include #include @@ -816,12 +815,10 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos) if (is_multi_extruder) { if (!ctrl->m_bmp_multi_extruder.bmp().IsOk()) ctrl->m_bmp_multi_extruder = ScalableBitmap(ctrl, "multi_extruder"); - const wxBitmap& bmp = ctrl->m_bmp_multi_extruder.bmp(); - // use logical size. GetWidth() returns physical pixels on macOS retina which pushes icon outside of control - const wxSize bmp_sz = get_bitmap_size(bmp); - const wxCoord icon_x = std::max(0, h_pos - bmp_sz.GetWidth() - ctrl->m_h_gap); - const wxCoord icon_y = v_pos + lround((height - bmp_sz.GetHeight()) / 2); - // draw directly to keep h_pos unchanged and avoid overwriting undo icon rects + const wxBitmap& bmp = ctrl->m_bmp_multi_extruder.bmp(); + const wxSize bmp_sz = get_bitmap_size(bmp); // Logical size. GetWidth() returns physical pixels on macOS retina which pushes icon outside of control + const wxCoord icon_x = std::max(0, h_pos - bmp_sz.GetWidth() - ctrl->m_h_gap); + const wxCoord icon_y = v_pos + lround((height - bmp_sz.GetHeight()) / 2); dc.DrawBitmap(bmp, icon_x, icon_y, true); } diff --git a/src/slic3r/GUI/OG_CustomCtrl.hpp b/src/slic3r/GUI/OG_CustomCtrl.hpp index 1d4b7cb428..c96582ed61 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.hpp +++ b/src/slic3r/GUI/OG_CustomCtrl.hpp @@ -20,6 +20,8 @@ #include "libslic3r/Config.hpp" +#include "slic3r/GUI/wxExtensions.hpp" + #include "OptionsGroup.hpp" class wxColour; @@ -51,8 +53,7 @@ class OG_CustomCtrl :public wxPanel wxSize m_bmp_mode_sz; wxSize m_bmp_blinking_sz; - // ORCA multi extruder icon drawn on left margin of variant options. created lazily on first use - ScalableBitmap m_bmp_multi_extruder; + ScalableBitmap m_bmp_multi_extruder; // ORCA multi extruder icon drawn on left margin for variant options int m_max_win_width{0};