remove pinch to zoom

This commit is contained in:
Pete Matsyburka committed 2026-10-03 14:05:38 +03:00
1 parent 1687a372ae
commit a990d22831
5 files changed
+24 -71

No files matched your search

@@ -81,6 +81,10 @@ export default {
coords: {
type: Object,
required: true
},
getResizeLimits: {
type: Function,
required: true
}
},
emits: ['command', 'resize'],
@@ -141,17 +145,17 @@ export default {
return (action.structural && !this.coords.isRegular) || action.disabled
},
startResize (event) {
this.resizeStart = { x: event.clientX, y: event.clientY, width: this.coords.width, height: this.coords.height }
this.resizeStart = { x: event.clientX, y: event.clientY, width: this.coords.width, height: this.coords.height, ...this.getResizeLimits() }
this.size = { width: this.coords.width, height: this.coords.height }
window.addEventListener('pointermove', this.onResizeMove)
window.addEventListener('pointerup', this.onResizeEnd)
},
onResizeMove (event) {
const { x, y, width, height } = this.resizeStart
const { x, y, width, height, minHeight, maxWidth } = this.resizeStart
this.size = {
width: Math.min(Math.max(width + event.clientX - x, 20), this.coords.maxWidth),
height: Math.max(height + event.clientY - y, this.coords.minHeight)
width: Math.min(Math.max(width + event.clientX - x, 20), maxWidth),
height: Math.max(height + event.clientY - y, minHeight)
}
},
onResizeEnd () {