Added check for rotation by narrow distance between touch points.
This commit is contained in:
+5
-1
@@ -286,6 +286,7 @@ export class AbstractScatter extends Throwable {
|
||||
scaleCloseThreshold = 0.1,
|
||||
scaleCloseBuffer = 0.05,
|
||||
maxRotation = Angle.degree2radian(5),
|
||||
minRotationDistance = 200,
|
||||
useLowPassFilter = true
|
||||
} = {}) {
|
||||
if (rotationDegrees != null && rotation != null) {
|
||||
@@ -331,6 +332,7 @@ export class AbstractScatter extends Throwable {
|
||||
this.mouseZoomFactor = mouseZoomFactor
|
||||
this.autoBringToFront = autoBringToFront
|
||||
this.useLowPassFilter = useLowPassFilter
|
||||
this.minRotationDistance = minRotationDistance
|
||||
if (useLowPassFilter) {
|
||||
this.rotateLPF = new LowPassFilter()
|
||||
this.zoomLPF = new LowPassFilter()
|
||||
@@ -387,7 +389,9 @@ export class AbstractScatter extends Throwable {
|
||||
if (this.useLowPassFilter) {
|
||||
rotate = this.rotateLPF.next(rotate)
|
||||
zoom = this.zoomLPF.next(zoom)
|
||||
// console.log({rotate, zoom})
|
||||
if (delta.distance < this.minRotationDistance) {
|
||||
rotate = 0
|
||||
}
|
||||
}
|
||||
this.transform(delta, zoom, rotate, delta.about)
|
||||
if (zoom != 1) this.interactionAnchor = delta.about
|
||||
|
||||
Reference in New Issue
Block a user