From 9f62aeabab9df4a6f292e89db8208b7ba52bf881 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 23 Sep 2021 16:37:27 +0200 Subject: [PATCH] DoubleSlider: Fixed a bug related to the unexpected mouse capture end Steps to repro: 1.Use left mouse button to move thumb of the DoubleSlider 2.Click by right mouse button 3.Thumb is moving even if you move the mouse out of the DoubleSlider --- src/slic3r/GUI/DoubleSlider.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index f830782612..77679a1ad9 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -1819,7 +1819,8 @@ void Control::OnChar(wxKeyEvent& event) void Control::OnRightDown(wxMouseEvent& event) { - if (HasCapture()) return; + if (HasCapture() || m_is_left_down) + return; this->CaptureMouse(); const wxPoint pos = event.GetLogicalPosition(wxClientDC(this)); @@ -2097,7 +2098,7 @@ void Control::auto_color_change() void Control::OnRightUp(wxMouseEvent& event) { - if (!HasCapture()) + if (!HasCapture() || m_is_left_down) return; this->ReleaseMouse(); m_is_right_down = m_is_one_layer = false;