From 9a5e9dfc36c0036aab83a06530e4a36c8a6dc353 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Fri, 14 Aug 2026 10:33:28 +0200 Subject: [PATCH] CAD: the wheel scrolls the card panel, it does not edit the field under it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wxSpinCtrlDouble takes the mouse wheel whenever the pointer is over it. A card taller than the panel therefore could not be scrolled past without silently incrementing whatever field the cursor happened to be over — measured on the rig: eight notches over the Coord Sys card turned an X hint from 1,00 into 6,00 while the panel did not move at all. The same gesture over an Extrude distance, a Hole diameter or a mate Offset is a silent model change made by someone who believed they were navigating, and nothing on screen reports it. Every spin in this panel comes from one factory, so the guard goes there: an unfocused spin hands the wheel to its parent, and the scrolled cards panel gets it. A spin the user has deliberately focused still takes the wheel, which is the one case where editing is what was meant. Verified on the rig with an Extrude card: eight notches over an unfocused Distance leave it at 10,00; clicking into it first and scrolling takes it to 13,00. --- src/slic3r/GUI/DesignPanel.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/DesignPanel.cpp index cc8f590c81..5401f15573 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/DesignPanel.cpp @@ -189,6 +189,18 @@ static wxSpinCtrlDouble* make_spin(wxWindow* parent, double val, s->SetRange(mn, mx); s->SetDigits(2); s->SetValue(val); + // THE WHEEL SCROLLS THE PANEL, IT DOES NOT EDIT THE VALUE. wxSpinCtrlDouble takes the wheel + // whenever the pointer is over it, so a card taller than the panel could not be scrolled past + // without silently incrementing whatever field happened to be under the cursor — measured: + // eight notches turned an X hint from 1,00 into 6,00, and the same gesture over an Extrude + // distance or a mate Offset is a silent model change made by someone who thought they were + // navigating. Skipping the event lets it reach the scrolled cards panel. A spin the user has + // deliberately focused still takes the wheel, which is the one case where editing is meant. + s->Bind(wxEVT_MOUSEWHEEL, [s](wxMouseEvent& e) { + if (wxWindow::FindFocus() == s) e.Skip(); // focused: wheel edits, as expected + else if (wxWindow* p = s->GetParent()) // otherwise hand it to the panel + wxPostEvent(p, e); + }); auto* sz = new wxBoxSizer(wxHORIZONTAL); sz->Add(s, 1, wxEXPAND | wxALL, parent->FromDIP(2)); box->SetSizer(sz);