mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fc000214a5
Mask vector data includes additive (brush, rect) shapes and subtractive (eraser) shapes. A different composite operation is used to draw a shape, depending on whether it is additive or subtractive. This means that a mask may have vector objects, but once rendered, is _visually_ empty (fully transparent). The only way determine if a mask is visually empty is to render it and check every pixel. When we generate and save layer metadata, these fully erased masks are still used. Generating with an empty mask is a no-op in the backend, so we want to avoid this and not pollute graphs/metadata. Previously, we did that pixel-based when calculating the bbox, which we only did when using the move tool, and only for the selected layer. This change introduces a simpler function to check if a mask is transparent, and if so, deletes all its objects to reset it. This allows us skip these no-op layers entirely. This check is debounced to 300 ms, trailing edge only. |
||
---|---|---|
.. | ||
.storybook | ||
patches | ||
public | ||
scripts | ||
src | ||
static/docs | ||
__init__.py | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.prettierignore | ||
.prettierrc.js | ||
index.html | ||
knip.ts | ||
package.json | ||
pnpm-lock.yaml | ||
README.md | ||
tsconfig.json | ||
tsconfig.node.json | ||
vite.config.mts |