Comfy-Org / Comfy-Org/ComfyUI_frontend

Mask Editor removes previously drawn mask

Open
#12,053 0 comments 1 reaction 0 assignees View on GitHub
area:mask-editor Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Prerequisites

- [x] I am running the latest version of ComfyUI
- [ ] I have custom nodes enabled

### What happened?

When trying to draw masks in the Mask Editor, it seems that when drawing strokes near the edges, drawing a new stroke after it completely removes the previously drawn stroke. I've noticed that this happens whenever one drags the stroke outside the canvas such that the cursor changes from a brush circle, to the default OS cursor. Then, when initiating a new stroke inside the canvas, it removes the previous stroke. This doesn't happen with all sides of the canvas, it happens most often with top and bottom. This is annoying when drawing masks close to the canvas edge. Happens in Chromium and Firefox. Here's a video of the bug:

https://github.com/user-attachments/assets/39c3d869-ebdd-4f7f-bd93-6126d610707a

### Steps to Reproduce

1. Open Mask Editor on an image.
2. Hold left mouse button to draw a mask, dragging the mask until leaving the canvas, when the mouse pointer turns into a default cursor arrow.
3. Let go of left mouse button, and draw a new mask.
4. The previously drawn mask disappears.

### How is this affecting you?

Feature doesn't work as expected

### ComfyUI Frontend Version

v1.42.15

### Browser

Chrome/Chromium

### Console Errors

```javascript

```

### Logs

```shell

```

### Additional Context

_No response_

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-12053-Mask-Editor-removes-previously-drawn-mask-3596d73d3650810e8b7fee4ec1e6cac5) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.