ensure image is always drawn (#3386)

* ensure image is always drawn

* fix demo

* notebooks

* clean
This commit is contained in:
pngwn 2023-03-06 16:04:42 +00:00 committed by GitHub
parent fba1bae3a5
commit fc39cbdd9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,7 @@
No changes to highlight.
## Bug Fixes:
No changes to highlight.
- Ensure uploaded images are always shown in the sketch tool by [@pngwn](https://github.com/pngwn) in [PR 3386](https://github.com/gradio-app/gradio/pull/3386)
## Documentation Changes:
No changes to highlight.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

File diff suppressed because one or more lines are too long

View File

@ -107,7 +107,11 @@
let line_count = 0;
function draw_cropped_image() {
if (!shape) return { x: 0, y: 0, width, height };
if (!shape) {
ctx.temp.drawImage(value_img, 0, 0, width, height);
return;
}
let _width = value_img.naturalWidth;
let _height = value_img.naturalHeight;