Scale to minScale when scaling beyond minScale
This commit is contained in:
parent
fbb4d71b1c
commit
b5d2e9fb41
6 changed files with 16 additions and 10 deletions
2
dist/pinch-zoom-min.js
vendored
2
dist/pinch-zoom-min.js
vendored
File diff suppressed because one or more lines are too long
5
dist/pinch-zoom.cjs.js
vendored
5
dist/pinch-zoom.cjs.js
vendored
|
@ -281,8 +281,9 @@ class PinchZoom extends HTMLElement {
|
|||
*/
|
||||
_updateTransform(scale, x, y, allowChangeEvent) {
|
||||
// Avoid scaling to zero
|
||||
if (scale < this.minScale)
|
||||
return;
|
||||
if (scale < this.minScale) {
|
||||
scale = this.minScale;
|
||||
}
|
||||
// Return if there's no change
|
||||
if (scale === this.scale &&
|
||||
x === this.x &&
|
||||
|
|
5
dist/pinch-zoom.es.js
vendored
5
dist/pinch-zoom.es.js
vendored
|
@ -277,8 +277,9 @@ class PinchZoom extends HTMLElement {
|
|||
*/
|
||||
_updateTransform(scale, x, y, allowChangeEvent) {
|
||||
// Avoid scaling to zero
|
||||
if (scale < this.minScale)
|
||||
return;
|
||||
if (scale < this.minScale) {
|
||||
scale = this.minScale;
|
||||
}
|
||||
// Return if there's no change
|
||||
if (scale === this.scale &&
|
||||
x === this.x &&
|
||||
|
|
5
dist/pinch-zoom.js
vendored
5
dist/pinch-zoom.js
vendored
|
@ -462,8 +462,9 @@ var PinchZoom = (function () {
|
|||
*/
|
||||
_updateTransform(scale, x, y, allowChangeEvent) {
|
||||
// Avoid scaling to zero
|
||||
if (scale < this.minScale)
|
||||
return;
|
||||
if (scale < this.minScale) {
|
||||
scale = this.minScale;
|
||||
}
|
||||
// Return if there's no change
|
||||
if (scale === this.scale &&
|
||||
x === this.x &&
|
||||
|
|
5
dist/pinch-zoom.mjs
vendored
5
dist/pinch-zoom.mjs
vendored
|
@ -277,8 +277,9 @@ class PinchZoom extends HTMLElement {
|
|||
*/
|
||||
_updateTransform(scale, x, y, allowChangeEvent) {
|
||||
// Avoid scaling to zero
|
||||
if (scale < this.minScale)
|
||||
return;
|
||||
if (scale < this.minScale) {
|
||||
scale = this.minScale;
|
||||
}
|
||||
// Return if there's no change
|
||||
if (scale === this.scale &&
|
||||
x === this.x &&
|
||||
|
|
|
@ -353,7 +353,9 @@ export default class PinchZoom extends HTMLElement {
|
|||
*/
|
||||
private _updateTransform(scale: number, x: number, y: number, allowChangeEvent: boolean) {
|
||||
// Avoid scaling to zero
|
||||
if (scale < this.minScale) return;
|
||||
if (scale < this.minScale) {
|
||||
scale = this.minScale;
|
||||
}
|
||||
|
||||
// Return if there's no change
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue