Scale to minScale when scaling beyond minScale

This commit is contained in:
Tusooa Zhu 2021-08-02 23:19:38 -04:00
parent fbb4d71b1c
commit b5d2e9fb41
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
6 changed files with 16 additions and 10 deletions

File diff suppressed because one or more lines are too long

View file

@ -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 &&

View file

@ -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
View file

@ -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
View file

@ -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 &&

View file

@ -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 (