Skip to content

Commit

Permalink
test(contain): add zoomWithWheel to contain: outside demo
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Apr 5, 2020
1 parent 100eaae commit e13e984
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions demo/examples/ContainOutside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export default function ContainOutside() {
useEffect(() => {
setTimeout(() => {
panzoom = Panzoom(elem.current, { contain: 'outside', startScale: 1.5 })
elem.current.parentNode.addEventListener('wheel', (e) => {
panzoom.zoomWithWheel(e as WheelEvent)
})
}, 1000)
}, [])
return (
Expand Down
1 change: 1 addition & 0 deletions test/unit/panzoom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ describe('Panzoom', () => {
// Zoom needs to paint first
await skipFrame()
panzoom.pan(100, 100)
await skipFrame()
// Should constrain to 25, 25
let pan = panzoom.getPan()
assert.equal(pan.x, 25)
Expand Down

0 comments on commit e13e984

Please sign in to comment.