fix(ui): prevent middle mouse from creating points in segmentation module

When middle mouse button is used for canvas panning, the pointerup event was still creating points in the segmentation module. Added button check to onBboxDragEnd handler to only process left clicks.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
psychedelicious
2025-09-10 20:13:34 +10:00
parent fb9545bb90
commit faac814a3d

View File

@@ -618,7 +618,7 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
return;
}
// Only handle left-clicks
// Only handle left-clicks (button 0). Ignore middle (1) and right (2) clicks
if (e.evt.button !== 0) {
return;
}
@@ -721,7 +721,7 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
// Handle visual mode
if (data.type === 'visual') {
// Only handle left-clicks
// Only handle left-clicks (button 0). Ignore middle (1) and right (2) clicks
if (e.evt.button !== 0) {
return;
}
@@ -870,6 +870,11 @@ export class CanvasSegmentAnythingModule extends CanvasModuleBase {
* Handles mouse/touch up for manual bbox dragging
*/
onBboxDragEnd = (e: KonvaEventObject<PointerEvent>) => {
// Only handle left-clicks (button 0). Ignore middle (1) and right (2) clicks
if (e.evt.button !== 0) {
return;
}
const dragStart = this.$bboxDragStart.get();
if (!dragStart) {
return;