From 8e12189b37136a3398d28cdbed9658fdaea74ee7 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 23 May 2019 10:55:57 +0200 Subject: [PATCH] Fixed filament color editing from Combobox (related to #2321) --- src/slic3r/GUI/Plater.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 1a5c32246..f3ad9c55d 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -259,7 +259,15 @@ wxBitmapComboBox(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(15 * if (preset_type == Slic3r::Preset::TYPE_FILAMENT) { Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &event) { - if (extruder_idx < 0 || event.GetLogicalPosition(wxClientDC(this)).x > 24) { + int shifl_Left = 0; + float scale = m_em_unit*0.1f; +#if defined(wxBITMAPCOMBOBOX_OWNERDRAWN_BASED) + shifl_Left = int(scale * 4 + 0.5f); // IMAGE_SPACING_RIGHT = 4 for wxBitmapComboBox -> Space left of image +#endif + int icon_right_pos = int(scale * (24+4) + 0.5); + int mouse_pos = event.GetLogicalPosition(wxClientDC(this)).x; +// if (extruder_idx < 0 || event.GetLogicalPosition(wxClientDC(this)).x > 24) { + if ( extruder_idx < 0 || mouse_pos < shifl_Left || mouse_pos > icon_right_pos ) { // Let the combo box process the mouse click. event.Skip(); return;