From d04f92ee7f3e0d1c0a80f14e84b884022de5ab2a Mon Sep 17 00:00:00 2001 From: uoestermeier Date: Thu, 11 Jul 2019 16:08:49 +0200 Subject: [PATCH] Added smoothing parameter to DOMScatter --- dist/iwmlib.js | 9 +++++++-- dist/iwmlib.pixi.js | 9 +++++++-- lib/scatter.js | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/dist/iwmlib.js b/dist/iwmlib.js index 3ba4f4b..847c842 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -3340,6 +3340,7 @@ if (this.useLowPassFilter) { rotate = this.rotateLPF.next(rotate); zoom = this.zoomLPF.next(zoom); + // console.log({rotate, zoom}) } this.transform(delta, zoom, rotate, delta.about); if (zoom != 1) this.interactionAnchor = delta.about; @@ -4039,7 +4040,9 @@ scaleAutoClose = false, onClose = null, scaleCloseThreshold = 0.10, - scaleCloseBuffer = 0.05 + scaleCloseBuffer = 0.05, + useLowPassFilter = true, + maxRotation = Angle.degree2radian(15) } = {} ) { super({ @@ -4063,7 +4066,9 @@ scaleAutoClose, scaleCloseThreshold, scaleCloseBuffer, - onClose + onClose, + useLowPassFilter, + maxRotation }); if (container == null || width == null || height == null) { throw new Error('Invalid value: null') diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 37526a9..30375bd 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -6507,6 +6507,7 @@ if (this.useLowPassFilter) { rotate = this.rotateLPF.next(rotate); zoom = this.zoomLPF.next(zoom); + // console.log({rotate, zoom}) } this.transform(delta, zoom, rotate, delta.about); if (zoom != 1) this.interactionAnchor = delta.about; @@ -7039,7 +7040,9 @@ scaleAutoClose = false, onClose = null, scaleCloseThreshold = 0.10, - scaleCloseBuffer = 0.05 + scaleCloseBuffer = 0.05, + useLowPassFilter = true, + maxRotation = Angle.degree2radian(15) } = {} ) { super({ @@ -7063,7 +7066,9 @@ scaleAutoClose, scaleCloseThreshold, scaleCloseBuffer, - onClose + onClose, + useLowPassFilter, + maxRotation }); if (container == null || width == null || height == null) { throw new Error('Invalid value: null') diff --git a/lib/scatter.js b/lib/scatter.js index 32a104c..1b19fa4 100644 --- a/lib/scatter.js +++ b/lib/scatter.js @@ -372,6 +372,7 @@ export class AbstractScatter extends Throwable { if (this.useLowPassFilter) { rotate = this.rotateLPF.next(rotate) zoom = this.zoomLPF.next(zoom) + // console.log({rotate, zoom}) } this.transform(delta, zoom, rotate, delta.about) if (zoom != 1) this.interactionAnchor = delta.about @@ -1071,7 +1072,9 @@ export class DOMScatter extends AbstractScatter { scaleAutoClose = false, onClose = null, scaleCloseThreshold = 0.10, - scaleCloseBuffer = 0.05 + scaleCloseBuffer = 0.05, + useLowPassFilter = true, + maxRotation = Angle.degree2radian(15) } = {} ) { super({ @@ -1095,7 +1098,9 @@ export class DOMScatter extends AbstractScatter { scaleAutoClose, scaleCloseThreshold, scaleCloseBuffer, - onClose + onClose, + useLowPassFilter, + maxRotation }) if (container == null || width == null || height == null) { throw new Error('Invalid value: null')