Skip to content

Commit

Permalink
Ensure image editor crop and draw cursor works as expected when the s…
Browse files Browse the repository at this point in the history
…croll position changes (#6502)
  • Loading branch information
pngwn authored and freddyaboulton committed Nov 21, 2023
1 parent 84c88c0 commit 7e0fea1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/whole-buckets-add.md
@@ -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
4 changes: 2 additions & 2 deletions gradio/components/image_editor.py
Expand Up @@ -68,8 +68,8 @@ def __post_init__(self):
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
Expand Down
2 changes: 2 additions & 0 deletions js/imageeditor/shared/ImageEditor.svelte
Expand Up @@ -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}
Expand Down

0 comments on commit 7e0fea1

Please sign in to comment.