diff options
author | Merill <merill@free.fr> | 2020-11-15 02:15:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 02:15:34 +0300 |
commit | 0f7298f70f964259fa670009db6b18d76ea6fbd2 (patch) | |
tree | 97f55d67f288e948417a496c4fd6c3ac252010cd | |
parent | cd2b502c38baf031d7b6ea3b846e53e8975f1cf6 (diff) |
Fix OG_CustomCtrl hpos computation for CoPointpatch-3
Problem :
* coPoint contain 2 windows in a sizer, and window() return only the first
* OG_CustomCtrl check only the window() and so miss the second one
solution:
* OG_CustomCtrl now check if the field has a sizer, and if so get all sizes from inside, like the correct_widgets_position method
-rw-r--r-- | src/slic3r/GUI/OG_CustomCtrl.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index 7feaacedc..611c08f40 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -180,8 +180,16 @@ wxPoint OG_CustomCtrl::get_pos(const Line& line, Field* field_in/* = nullptr*/) h_pos += 3 * 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; |