Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/jsvectormap/src/js/core/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import Events from '../defaults/events'
export default function setScale(scale, anchorX, anchorY, isCentered, animate) {
let zoomStep,
interval,
i = 0,
count = Math.abs(Math.round((scale - this.scale) * 60 / Math.max(scale, this.scale))),
scaleStart,
scaleDiff,
transXStart,
transXDiff,
transYStart,
transYDiff,
transX,
transY
if (scale > this.params.zoomMax * this.baseScale) {
scale = this.params.zoomMax * this.baseScale
} else if (scale < this.params.zoomMin * this.baseScale) {
scale = this.params.zoomMin * this.baseScale
}
if (typeof anchorX != 'undefined' && typeof anchorY != 'undefined') {
zoomStep = scale / this.scale
if (isCentered) {
transX = anchorX + this.defaultWidth * (this.width / (this.defaultWidth * scale)) / 2
transY = anchorY + this.defaultHeight * (this.height / (this.defaultHeight * scale)) / 2
} else {
transX = this.transX - (zoomStep - 1) / scale * anchorX
transY = this.transY - (zoomStep - 1) / scale * anchorY
}
}
if (animate && count > 0) {
scaleStart = this.scale
scaleDiff = (scale - scaleStart) / count
transXStart = this.transX * this.scale
transYStart = this.transY * this.scale
transXDiff = (transX * scale - transXStart) / count
transYDiff = (transY * scale - transYStart) / count
interval = setInterval(() => {
i += 1
this.scale = scaleStart + scaleDiff * i
this.transX = (transXStart + transXDiff * i) / this.scale
this.transY = (transYStart + transYDiff * i) / this.scale
this.applyTransform()
if (i == count) {
clearInterval(interval)
this.emit(Events.onViewportChange, [
this.scale, this.transX, this.transY
])
}
}, 10)
} else {
this.transX = transX
this.transY = transY
this.scale = scale
this.applyTransform()
this.emit(Events.onViewportChange, [
this.scale, this.transX, this.transY
])
}
} |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0062 ]-- |