Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Image): Image mod is mask or color-sketch bug; #4692

Merged
merged 7 commits into from Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@

## Bug Fixes:

- Ensure the `Image` components undo button works mode is `mask` or `color-sketch` by [@amyorz](https://github.com/AmyOrz) in [PR 4692](https://github.com/gradio-app/gradio/pull/4692)
- Load the iframe resizer external asset asynchronously, by [@akx](https://github.com/akx) in [PR 4336](https://github.com/gradio-app/gradio/pull/4336)
- Restored missing imports in `gr.components` by [@abidlabs](https://github.com/abidlabs) in [PR 4566](https://github.com/gradio-app/gradio/pull/4566)
- Fix bug where `select` event was not triggered in `gr.Gallery` if `height` was set to be large with `allow_preview=False` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4551](https://github.com/gradio-app/gradio/pull/4551)
Expand Down
11 changes: 5 additions & 6 deletions js/image/src/Sketch.svelte
Expand Up @@ -241,8 +241,10 @@
draw_lines({ lines: _lines });
line_count = _lines.length;

if (lines.length) {
lines = _lines;
lines = _lines;
ctx.drawing.drawImage(canvas.temp, 0, 0, width, height);
if (mode === "mask") {
ctx.mask.drawImage(canvas.temp_fake, 0, 0, width, height);
}

if (lines.length == 0) {
Expand Down Expand Up @@ -288,11 +290,8 @@
brush_radius
});
}

points = _points;

return;
});

saveLine({ brush_color, brush_radius });
if (mode === "mask") {
save_mask_line();
Expand Down