Skip to content

Commit

Permalink
fix(Screen): change double-click behaviour for screenshare panzoom
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Jan 30, 2025
1 parent 9815309 commit e4f65e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/CallView/shared/Screen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ export default {
maxZoom: 8,
bounds: true,
boundsPadding: 1,
zoomDoubleClickSpeed: 1, // disable default zoom factor (1.75)
onDoubleClick: (e) => {
if (instanceTransform.value.scale === 1) {
const clientRect = screen.value.parentElement.getBoundingClientRect()
const offsetX = e.clientX - clientRect.left
const offsetY = e.clientY - clientRect.top
instance.value.zoomAbs(offsetX, offsetY, 4)
} else {
instance.value.zoomAbs(0, 0, 1)
}
}
})
instance.value.on('zoom', (instance) => {
instanceTransform.value = instance.getTransform()
Expand Down

0 comments on commit e4f65e3

Please sign in to comment.