Skip to content

fix: AMS slot edit icon click detection misses Y-bound check#10859

Open
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10764-ams-slot-click-detection
Open

fix: AMS slot edit icon click detection misses Y-bound check#10859
BenJule wants to merge 3 commits into
bambulab:masterfrom
BenJule:fix/10764-ams-slot-click-detection

Conversation

@BenJule

@BenJule BenJule commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

AMSLib::on_left_down() checks top <= bottom as the upper Y bound for the edit-icon hit-test, but top is always less than or equal to bottom by construction, so this condition is always true. Any click with the correct X range triggers the edit dialog regardless of how far below the icon the click lands.

One-character fix: replace top <= bottom with pos.y <= bottom.

Applies to all AMS model variants (AMS, N3F, N3S, EXT_SPOOL, AMS_LITE).

Closes #10858

Changed file

  • src/slic3r/GUI/Widgets/AMSItem.cpp — line 1039

Test plan

  • Click on the edit icon of an AMS slot → edit dialog opens
  • Click just below the edit icon → dialog does NOT open
  • Click above the edit icon (but still in X range) → dialog does NOT open

BenJule added 3 commits May 21, 2026 10:52
The upstream build_all.yml only listed 'main' as a push trigger.
BenJule/BambuStudio uses 'master' as its default branch, so CI never
fired on fork-local pushes. Adding 'master' alongside 'main' makes
the full multi-platform build run when master is updated.
AMSLib::on_left_down() checked pos.y >= top but compared top <= bottom
instead of pos.y <= bottom for the upper bound. Since top is always <=
bottom by construction, the condition was always true, so any click
below the icon still triggered the edit event.

Replace the tautological top <= bottom with pos.y <= bottom so the
hit-test properly constrains both axes.
@BenJule BenJule force-pushed the fix/10764-ams-slot-click-detection branch from 406bd08 to 3973958 Compare May 21, 2026 08:55
@BenJule BenJule closed this Jun 7, 2026
@BenJule BenJule deleted the fix/10764-ams-slot-click-detection branch June 7, 2026 10:09
@BenJule BenJule restored the fix/10764-ams-slot-click-detection branch June 7, 2026 11:37
@BenJule BenJule reopened this Jun 7, 2026
@BenJule

BenJule commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change.

It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AMS slot edit icon is triggered by clicks outside its Y bounds

1 participant