Ensure image editor crop and draw cursor works as expected when the scroll position changes (#6502)

This commit is contained in:
pngwn 2023-11-20 15:13:04 +00:00 committed by GitHub
parent 2780d067f9
commit 070f71c933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/imageeditor": patch
"gradio": patch
---
fix:Ensure image editor crop and draw cursor works as expected when the scroll position changes

View File

@ -68,8 +68,8 @@ class Brush(Eraser):
class ImageEditor(Component):
"""
Creates an image component that can be used to upload and edit images (as an input) or display images (as an output).
Preprocessing: passes the uploaded image as a ductionary of {numpy.array}, {PIL.Image} or {str} filepath depending on `type`.
Postprocessing: expects a ductinoary of {numpy.array}, {PIL.Image} or {str} or {pathlib.Path} filepath to an image and displays the image.
Preprocessing: passes the uploaded image as a dictionary of {numpy.array}, {PIL.Image} or {str} filepath depending on `type`.
Postprocessing: expects a dictionary of {numpy.array}, {PIL.Image} or {str} or {pathlib.Path} filepath to an image and displays the image.
Examples-format: a {str} local filepath or URL to an image.
Demos: image_mod, image_mod_default_image
Guides: image-classification-in-pytorch, image-classification-in-tensorflow, image-classification-with-vision-transformers, building-a-pictionary_app, create-your-own-friends-with-a-gan

View File

@ -308,6 +308,8 @@
}
</script>
<svelte:window on:scroll={() => get_dimensions(canvas_wrap, pixi_target)} />
<div data-testid="image" class="image-container">
<Controls
can_undo={$can_undo}