Skip to content

Commit

Permalink
Fix incorrect relative mouse coordinates for Gallery preview overlay (
Browse files Browse the repository at this point in the history
#7516)

* Fix incorrect relative mouse coordinates for `Gallery` preview overlay

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
MMP0 and gradio-pr-bot committed Mar 4, 2024
1 parent fc4c2db commit 3645da5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/smooth-pens-beam.md
@@ -0,0 +1,6 @@
---
"@gradio/gallery": minor
"gradio": minor
---

feat:Fix incorrect relative mouse coordinates for `Gallery` preview overlay
2 changes: 1 addition & 1 deletion js/gallery/shared/Gallery.svelte
Expand Up @@ -82,7 +82,7 @@
function handle_preview_click(event: MouseEvent): void {
const element = event.target as HTMLElement;
const x = event.clientX;
const x = event.offsetX;
const width = element.offsetWidth;
const centerX = width / 2;
Expand Down

0 comments on commit 3645da5

Please sign in to comment.