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
This commit is contained in:
YuSanka 2021-09-23 16:37:27 +02:00
parent 6af09cd3ea
commit 9f62aeabab

View file

@ -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;