Skip to content

Commit

Permalink
add minZoom & maxZoom to test page to be able to test zoom less than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
drijnkels committed Jan 15, 2024
1 parent 66d1551 commit 90882a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
let crop = { x: 0, y: 0 }
let zoom = 1
let minZoom = 0.5;
let maxZoom = 3;
const urlArgs = typeof window !== 'undefined' ? queryString.parse(window.location.search) : null
let image = typeof urlArgs?.img === 'string' ? urlArgs.img : '/images/dog.jpeg' // so we can change the image from our tests
</script>

<Cropper {image} bind:crop bind:zoom on:cropcomplete={e => console.log(e.detail)} />
<Cropper
{image}
bind:crop
bind:zoom
bind:minZoom
bind:maxZoom
on:cropcomplete={e => console.log(e.detail)}
/>

0 comments on commit 90882a9

Please sign in to comment.