From 16d3314d9f308a99f0ea9bf19e33cc0663bd0ecc Mon Sep 17 00:00:00 2001 From: supermerill Date: Sun, 15 Nov 2020 00:11:25 +0100 Subject: [PATCH] #658 fix coPoints size computation --- src/slic3r/GUI/Field.hpp | 1 + src/slic3r/GUI/OG_CustomCtrl.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index da2b94958..5d45f4154 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -460,6 +460,7 @@ public: x_textctrl->Disable(); y_textctrl->Disable(); } wxSizer* getSizer() override { return sizer; } + //for height wxWindow* getWindow() override { return dynamic_cast(x_textctrl); } }; diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 48638fc03..37213fba5 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -201,8 +201,16 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/) h_pos += 2 * blinking_button_width; if (field == field_in) - break; - h_pos += field->getWindow()->GetSize().x; + break; + if (field->getSizer()) { + for (auto child : field->getSizer()->GetChildren()) { + if (child->IsWindow() && child->IsShown()) { + wxSize sz = child->GetWindow()->GetSize(); + h_pos += sz.x + m_h_gap; + } + } + } else + h_pos += field->getWindow()->GetSize().x; if (option_set.size() == 1 && option_set.front().opt.full_width) break;