diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp
index c9b8d5368a..13a9fa1283 100644
--- a/src/slic3r/GUI/Field.cpp
+++ b/src/slic3r/GUI/Field.cpp
@@ -196,6 +196,11 @@ void Field::on_back_to_sys_value()
m_back_to_sys_value(m_opt_id);
}
+void Field::on_edit_value()
+{
+ if (m_fn_edit_value)
+ m_fn_edit_value(m_opt_id);
+}
/// Fires the enable or disable function, based on the input.
diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp
index 58b5dd5e2d..b5f5ceb956 100644
--- a/src/slic3r/GUI/Field.hpp
+++ b/src/slic3r/GUI/Field.hpp
@@ -183,6 +183,8 @@ public:
void on_back_to_initial_value();
/// Call the attached m_back_to_sys_value method.
void on_back_to_sys_value();
+ /// Call the attached m_fn_edit_value method.
+ void on_edit_value();
public:
/// parent wx item, opportunity to refactor (probably not necessary - data duplication)
@@ -198,6 +200,9 @@ public:
t_back_to_init m_back_to_initial_value{ nullptr };
t_back_to_init m_back_to_sys_value{ nullptr };
+ /// Callback function to edit field value
+ t_back_to_init m_fn_edit_value{ nullptr };
+
// This is used to avoid recursive invocation of the field change/update by wxWidgets.
bool m_disable_change_event {false};
bool m_is_modified_value {false};
diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp
index 68ffe0de89..2d796924aa 100644
--- a/src/slic3r/GUI/OG_CustomCtrl.cpp
+++ b/src/slic3r/GUI/OG_CustomCtrl.cpp
@@ -373,22 +373,31 @@ void OG_CustomCtrl::OnMotion(wxMouseEvent& event)
break;
}
- for (size_t opt_idx = 0; opt_idx < line.rects_undo_icon.size(); opt_idx++)
+ size_t undo_icons_cnt = line.rects_undo_icon.size();
+ assert(line.rects_undo_icon.size() == line.rects_undo_to_sys_icon.size());
+ const std::vector