mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user