Improved handling of min rotation distance.
This commit is contained in:
Vendored
+12
-8
@@ -3374,8 +3374,8 @@
|
||||
scaleCloseThreshold = 0.1,
|
||||
scaleCloseBuffer = 0.05,
|
||||
maxRotation = Angle.degree2radian(5),
|
||||
minRotationDistance = 200,
|
||||
useLowPassFilter = true
|
||||
minRotationDistance = 0,
|
||||
useLowPassFilter = false
|
||||
} = {}) {
|
||||
if (rotationDegrees != null && rotation != null) {
|
||||
throw new Error('Use rotationDegrees or rotation but not both')
|
||||
@@ -3477,10 +3477,12 @@
|
||||
if (this.useLowPassFilter) {
|
||||
rotate = this.rotateLPF.next(rotate);
|
||||
zoom = this.zoomLPF.next(zoom);
|
||||
if (delta.distance < this.minRotationDistance) {
|
||||
rotate = 0;
|
||||
}
|
||||
}
|
||||
if (delta.distance < this.minRotationDistance) {
|
||||
let ratio = delta.distance / this.minRotationDistance;
|
||||
rotate *= ratio;
|
||||
}
|
||||
|
||||
this.transform(delta, zoom, rotate, delta.about);
|
||||
if (zoom != 1) this.interactionAnchor = delta.about;
|
||||
}
|
||||
@@ -4198,8 +4200,9 @@
|
||||
onClose = null,
|
||||
scaleCloseThreshold = 0.1,
|
||||
scaleCloseBuffer = 0.05,
|
||||
useLowPassFilter = true,
|
||||
maxRotation = Angle.degree2radian(15)
|
||||
useLowPassFilter = false,
|
||||
maxRotation = Angle.degree2radian(15),
|
||||
minRotationDistance = 200
|
||||
} = {}
|
||||
) {
|
||||
super({
|
||||
@@ -4225,7 +4228,8 @@
|
||||
scaleCloseBuffer,
|
||||
onClose,
|
||||
useLowPassFilter,
|
||||
maxRotation
|
||||
maxRotation,
|
||||
minRotationDistance
|
||||
});
|
||||
if (container == null || width == null || height == null) {
|
||||
throw new Error('Invalid value: null')
|
||||
|
||||
Vendored
+12
-8
@@ -6786,8 +6786,8 @@
|
||||
scaleCloseThreshold = 0.1,
|
||||
scaleCloseBuffer = 0.05,
|
||||
maxRotation = Angle.degree2radian(5),
|
||||
minRotationDistance = 200,
|
||||
useLowPassFilter = true
|
||||
minRotationDistance = 0,
|
||||
useLowPassFilter = false
|
||||
} = {}) {
|
||||
if (rotationDegrees != null && rotation != null) {
|
||||
throw new Error('Use rotationDegrees or rotation but not both')
|
||||
@@ -6889,10 +6889,12 @@
|
||||
if (this.useLowPassFilter) {
|
||||
rotate = this.rotateLPF.next(rotate);
|
||||
zoom = this.zoomLPF.next(zoom);
|
||||
if (delta.distance < this.minRotationDistance) {
|
||||
rotate = 0;
|
||||
}
|
||||
}
|
||||
if (delta.distance < this.minRotationDistance) {
|
||||
let ratio = delta.distance / this.minRotationDistance;
|
||||
rotate *= ratio;
|
||||
}
|
||||
|
||||
this.transform(delta, zoom, rotate, delta.about);
|
||||
if (zoom != 1) this.interactionAnchor = delta.about;
|
||||
}
|
||||
@@ -7434,8 +7436,9 @@
|
||||
onClose = null,
|
||||
scaleCloseThreshold = 0.1,
|
||||
scaleCloseBuffer = 0.05,
|
||||
useLowPassFilter = true,
|
||||
maxRotation = Angle.degree2radian(15)
|
||||
useLowPassFilter = false,
|
||||
maxRotation = Angle.degree2radian(15),
|
||||
minRotationDistance = 200
|
||||
} = {}
|
||||
) {
|
||||
super({
|
||||
@@ -7461,7 +7464,8 @@
|
||||
scaleCloseBuffer,
|
||||
onClose,
|
||||
useLowPassFilter,
|
||||
maxRotation
|
||||
maxRotation,
|
||||
minRotationDistance
|
||||
});
|
||||
if (container == null || width == null || height == null) {
|
||||
throw new Error('Invalid value: null')
|
||||
|
||||
Reference in New Issue
Block a user