Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/slic3r/GUI/TabButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,11 @@ void TabButton::mouseReleased(wxMouseEvent &event)
event.Skip();
if (pressedDown) {
pressedDown = false;
ReleaseMouse();
if (wxRect({0, 0}, GetSize()).Contains(event.GetPosition()))
if (HasCapture())
ReleaseMouse();
// Touch input drift slop — see Button::mouseReleased.
constexpr int kReleaseSlop = 15;
if (wxRect({0, 0}, GetSize()).Inflate(kReleaseSlop).Contains(event.GetPosition()))
sendButtonEvent();
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/slic3r/GUI/Widgets/AxisCtrlButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,14 @@ void AxisCtrlButton::mouseReleased(wxMouseEvent& event)
event.Skip();
if (pressedDown) {
pressedDown = false;
ReleaseMouse();
if (wxRect({ 0, 0 }, GetSize()).Contains(event.GetPosition()))
if (HasCapture())
ReleaseMouse();
// Touch input drift slop — see Button::mouseReleased. The active
// wedge is tracked in current_pos by mouseMove, so the correct
// axis still fires; the slop just keeps the click alive when a
// touch lands a few pixels outside the wedge ring on release.
constexpr int kReleaseSlop = 15;
if (wxRect({ 0, 0 }, GetSize()).Inflate(kReleaseSlop).Contains(event.GetPosition()))
sendButtonEvent();
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/slic3r/GUI/Widgets/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,18 @@ void Button::mouseReleased(wxMouseEvent& event)
pressedDown = false;
if (HasCapture())
ReleaseMouse();
if (wxRect({0, 0}, GetSize()).Contains(event.GetPosition()))
// Touch input drift slop. The button-up position can land a few
// pixels outside the rect after a tap because finger contact rolls
// between press and release; the original strict
// wxRect({0,0},GetSize()).Contains(...) check silently dropped
// those clicks on every touchscreen device (visible symptom on
// Cancel buttons, AMS spool selectors, sidebar tabs, etc.).
// Inflating the hit area by kReleaseSlop on each side preserves
// the deliberate drag-off-to-cancel gesture for desktop mouse
// users (any release more than ~15 px outside still cancels)
// while accepting the small finger drift typical of touchscreens.
constexpr int kReleaseSlop = 15;
if (wxRect({0, 0}, GetSize()).Inflate(kReleaseSlop).Contains(event.GetPosition()))
sendButtonEvent();
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/slic3r/GUI/Widgets/SideButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ void SideButton::mouseReleased(wxMouseEvent& event)

if (pressedDown) {
pressedDown = false;
if (wxRect({0, 0}, GetSize()).Contains(event.GetPosition()))
// Touch input drift slop — see Button::mouseReleased.
constexpr int kReleaseSlop = 15;
if (wxRect({0, 0}, GetSize()).Inflate(kReleaseSlop).Contains(event.GetPosition()))
sendButtonEvent();
}
}
Expand Down